Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

family tree?

16 views
Skip to first unread message

Student

unread,
Apr 28, 2001, 5:14:18 AM4/28/01
to
i'm a newbie working on a C++ porgram which funtions like a family tree

there are many inputs to the program,but
each input of the program are just a person's name together
with his/her mother&father's name,

while the output requires to give all the father, mother, grandfathers,
grandmothers,
grand-grandfathers, grand-grandmothers.........etc...........together with
the sons, duaghters,
grandsons, granddaughters, grand-grandson, grand-granddaughter etc of the
person requested,
but ouputted in order of their generation level.

so what is an efficient data structure &alogrithim for implementing such a
program?
should i used something like a linked list?

thank you for any comment and answer.


CBFalconer

unread,
Apr 28, 2001, 8:15:29 AM4/28/01
to
Student wrote:
>
> there are many inputs to the program,but
> each input of the program are just a person's name together
> with his/her mother&father's name,
>
... snip ...

>
> so what is an efficient data structure &alogrithim for implementing such a
> program?

look into B-trees. (B, not binary).

--
Chuck F (cbfal...@my-deja.com) (cbfal...@XXXXworldnet.att.net)
http://www.qwikpages.com/backstreets/cbfalconer :=(down for now)
(Remove "NOSPAM." from reply address. my-deja works unmodified)
mailto:u...@ftc.gov (for spambots to harvest)

Student

unread,
Apr 28, 2001, 8:38:21 AM4/28/01
to
thanks for ur reply
but may i ask what are B-trees?
(would u mind explaining it a bit ?)
coz i have never heard of such a thing..

"CBFalconer" <cbfal...@my-deja.com> wrote in message
news:3AEAB2AC...@my-deja.com...

CBFalconer

unread,
Apr 28, 2001, 9:29:35 AM4/28/01
to
**** Kindly DO NOT top-post - fixed ***

Student wrote:
>
> "CBFalconer" <cbfal...@my-deja.com> wrote in message
> news:3AEAB2AC...@my-deja.com...
> > Student wrote:
> > >
> > > there are many inputs to the program,but
> > > each input of the program are just a person's name together
> > > with his/her mother&father's name,
> > >
> > ... snip ...
> > >
> > > so what is an efficient data structure &alogrithim for implementing
> > > such a program?
> >
> > look into B-trees. (B, not binary).
>
> thanks for ur reply
> but may i ask what are B-trees?
> (would u mind explaining it a bit ?)
> coz i have never heard of such a thing..

Try a suitable algorithms book. Sedgewicks "Algorithms in C"
comes to mind, along with Knuths "Algorithms + Data Structures =
Programs". There is always Knuth.

Please avoid top-posting and silly abbreviations - they make
things hard to read.

Joe Butler

unread,
Apr 28, 2001, 11:24:46 AM4/28/01
to
Why don't people like 'top posts' (I assume this is a top post)?
I find it far more difficult to read a thread when people 'bottom post'(?).
It means that I need to scroll virtually every message I want to read.


"CBFalconer" <cbfal...@my-deja.com> wrote in message

news:3AEAC3CC...@my-deja.com...

Tobias Brox

unread,
Apr 28, 2001, 11:16:07 AM4/28/01
to
CBFalconer <cbfal...@my-deja.com> wrote:
> Try a suitable algorithms book. Sedgewicks "Algorithms in C"
> comes to mind, along with Knuths "Algorithms + Data Structures =
> Programs". There is always Knuth.

Haven't read Knuth, but Sedgewicks certainly was interessting. I made
some libraries just for myself, where an indexing key and a pointer to
some data was stored in a B-tree. Certainly it was enjoyable playing
around with it, doing optimalizations, profiling it, etc.

Anyway, wouldn't it be a bit overkill to read Sedgewick just to build
some application for tracking family relationships? There must be some
ready-to-use libraries out there for handling such things? Where will
we get if every technically minded person makes his/her own
implementation of btrees before they can get further with their real
ideas? Wouldn't it be better to look for some already existing
libraries?

Myself I was programming a bit in C and eventually C++, but when I
discovered Perl I got in love. It's a darn ugly language, but it's
extremely simple to fix things fast there, through the built-in hash
data type or through all the library modules available at CPAN.

Anyway, maybe the best solution might be to operate towards a database?

As I've understood it, the planned program should record family
relationship data and probably store it locally to a disk. Aren't there
a lot of existing programs doing this already? And what is the use that
everybody sits by themselves storing such information locally? Wouldn't
it be a better idea to have a program that is globally accessible (i.e.
through some web interface) where anybody can store whatever information
they have? You might get some management problems (i.e. names that are
spelt in different ways, several persons having the same name, people
that feeds the system with random or false data, etc), but it would
certainly be a better idea.

Just some thoughts.

--
Tobias Brox, freelance hacker for hire.
Good at solving problems.
+47 98660706 / tob...@suptra.org

Richard Heathfield

unread,
Apr 28, 2001, 12:52:49 PM4/28/01
to
Joe Butler wrote:
>
> Why don't people like 'top posts' (I assume this is a top post)?

It is. But this isn't. Rational people don't like top posts for the same
reason they don't like to start reading a novel at the top of the last
page.

> I find it far more difficult to read a thread when people 'bottom post'(?).

You wouldn't do, if people correctly snipped out the bits to which they
are *not* replying (as I have done).

> It means that I need to scroll virtually every message I want to read.

How about this one?

--
Richard Heathfield
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton

CBFalconer

unread,
Apr 28, 2001, 2:46:30 PM4/28/01
to

Because it makes no sense to read, and it encourages failure to
edit quotations. You could have snipped everything except the
attribution above "Please avoid". The result would be a coherent
whole. My old signature line is a total waste. The resulting
everincreasing articles are a ridiculous waste of transmission
time. You will never annoy by bottom posting.

Tobias Brox

unread,
Apr 28, 2001, 4:43:48 PM4/28/01
to
Is news.misc the right place to discuss the style of UseNet articles? I
hope it's not considered too inapropriate to crosspost there.

Joe Butler <ff...@hot.mailspam.com> wrote:
> Why don't people like 'top posts' (I assume this is a top post)?
> I find it far more difficult to read a thread when people 'bottom post'(?).
> It means that I need to scroll virtually every message I want to read.

This is not the apropriate forum to discuss this, and this have probably
been discussed over and over again all over UseNet. Probably there
exists FAQs telling the pro and cons of both methods. Probably
searching a bit at news.answers will give some nice articles. URLs, anybody?

Anyway, here is my personal version. What is the reason to quote at
all? Consider it. It shouldn't be to allow people to scroll down to
see all earlier discussions. If the news client is a bit smart,
fetching the older articles from the server should be just as easy as to
"scroll down". If a thread goes forth and back some times and earlier
quotes accumulate, an article including all those quotes might get
five-ten times larger than a posting withing quotes, this hugs bandwidth
and harddisk space. Therefore, IMHO, no quotes are far better than a
posting at the top of all old quotes.

At the other hand, it's very easy to loose the context in a posting
without any quoting at all. Letting the reader understand the context
is very important for easy reading. Therefore there should always be
_some few_ lines reminding the reader about what kind of discussion he is
into.

If a person has to _scroll down_ to read the new information, there are
probably too much quotes in the article. A person that is good to use
quotes never quote more than some few lines at once. If I can't find
the right lines to quote, I often replace all the quotes with a short
summary of the discussion so far. Actually I can agree that it is more
annoying when complete articles are quoted with a small "yes" or "no" at
the bottom than to read a top-post.

There is also another very important aspect with quoting that shouldn't
be underestimated; the quotes should tell _what parts_ of an article
you're replying to. Often you have some viewpoints about some parts of
an article, and other viewpoints about other parts of it. The best way
to solve that is to qoute a little bit, come with some comments, quote some
more, and then write some comments to that as well. This can't at all
be done in a top-posting.

Also, I get very annoyed when I send an email with a lot of questions,
and somebody (using the top-post method) replies to the first or the
last question, but forget the rest. Even from the posters point of view
it should be better to do it the preffered way, as it's easier to keep
track of what you've commented and what you still haven't commented.

There is a small danger in the preffered way of quoting; it's easy to
overlook the completeness of an article, and start nitpicking about the
details instead. People wanting to get something positive out of news
should be very careful not to waste too much time on useless,
counter-productive discussions anyway.

Top-postings became popular when the mass started using Internet and
particularly mail. Ordinary, clueless people quote all the article, or
quotes the article below their own posting/mail because it requires less
time, because they haven't thought much of the purpose of quoting, and
because their software are optimized for such use. As the growth of
"ordinary" users using Internet has been far greater than the speed of
public "education", top-postings has, unfortunately, become a de-facto
standard in emails, mailing lists, as well as quite some non-technical
newsgroups.

Jukka K. Korpela

unread,
Apr 29, 2001, 1:25:34 PM4/29/01
to
Under Subject "Re: family tree?", Tobias Brox <tob...@suptra.org>
wrote:

>Is news.misc the right place to discuss the style of UseNet articles?

Certainly better than comp.programming!

>I hope it's not considered too inapropriate to crosspost there.

When a discussion has become off-topic in some group and one tries to
move it to a more suitable group, the best method is probably to
crosspost it and set followups to the suitable group, and mention this
in the article (since not all people note that otherwise). OK, I did
that now. It's difficult to say what to do with the Subject line, since
it very often does not reflect the actual topic at all, but any changes
to Subject line cause some problems. Perhaps it's best to change the
Subject then but mention the old Subject line in the body, as I've done.

>Probably there exists FAQs telling the pro and cons of both methods

>[ = bottom and top posting ]. Probably searching a bit at news.answers


>will give some nice articles. URLs, anybody?

As regards to Usenet netiquette in general, there's the problem that
there are several FAQs, some of which are relatively old. In fact their
_content_ is mostly very applicable still, but the style, references to
dated examples, etc., might give the impression of something
old-fashioned. Moreover, a novice might be puzzled by the diversity of
FAQs. So I've composed a small annotated list of FAQs and similar
resources about Usenet: http://www.malibutelecom.com/yucca/usenet/
(Somewhat dated too. :-) Still refers to Deja, but I've been waiting for
some stabilization of Google's Usenet search before changing n+1 pages.)

About posting style, I'd recommend the concise
http://www.xs4all.nl/%7ewijnands/nnq/nquote.html

>Anyway, here is my personal version.

A good presentation. How about putting it onto the Web? It's useful to
have several documents explaining these things, in different ways and
styles. People who don't get the point upon first reading (and I'm
afraid most of us don't) might prefer reading a somewhat _different_
explanation, instead of rereading a document until they understand what
it says.

>There is a small danger in the preffered way of quoting; it's easy to
>overlook the completeness of an article, and start nitpicking about the
>details instead.

I wouldn't say that the preferred way of quoting _causes_ that. Rather,
it makes it more obvious what's happening. Wouldn't it be even more
harmful if I nitpicked about something without even pointing at _what_
details I'm commenting upon?
--
Yucca, http://www.malibutelecom.com/yucca/
(mirror under construction at
http://www.cs.tut.fi/~jkorpela/ )

Al Dunbar

unread,
Apr 29, 2001, 3:43:33 PM4/29/01
to

"Joe Butler" <ff...@hot.mailspam.com> wrote in message
news:9cencg$kvd$1...@newsg2.svr.pol.co.uk...

> Why don't people like 'top posts' (I assume this is a top post)?
> I find it far more difficult to read a thread when people 'bottom
post'(?).
> It means that I need to scroll virtually every message I want to read.

Order reverse in discussion a follow to hard is it because.

Or, if you prefer to read some comments about this in forward-speak, have a
look at:

http://www.xs4all.nl/~wijnands/nnq/nquote.html

/Al

Programmer Dude

unread,
May 1, 2001, 11:49:27 AM5/1/01
to
Richard Heathfield wrote:

>> It means that I need to scroll virtually every message I want to read.
>
> How about this one?

Yep.

But I had my window size set to four lines.... ;-|


--
|_ CJSonnack <Ch...@Sonnack.com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL |
|_____________________________________________|_______________________|

Opinions expressed herein are my own and may not represent those of my employer.

Programmer Dude

unread,
May 1, 2001, 12:00:06 PM5/1/01
to
Tobias Brox wrote:

> Anyway, here is my personal version. What is the reason to quote at
> all? Consider it.

To create a sense of conversational back and forth to a post.

> If the news client is a bit smart, fetching the older articles from
> the server should be just as easy as to "scroll down".

USENET is huge. Very huge. Some news servers place severe time and size
limits on how much they keep (all of USENET is--I believe--several gig
per *day*).

> Therefore, IMHO, no quotes are far better than a posting at the top
> of all old quotes.

Personally, I'm not bothered much by top posting (prefer bottom, but I
try to be flexible). I AM bothered by poor editing of quotes, though.

> At the other hand, it's very easy to loose the context in a posting
> without any quoting at all. Letting the reader understand the context
> is very important for easy reading.

Yep. Exactly.

> If a person has to _scroll down_ to read the new information, there are
> probably too much quotes in the article.

My general rule of thumb is, if a new message appears on my screen--and
I can see about fourty lines of text in my usual window size--and all I
see is quotes, it's on to the next message. (Although the scroll wheel
mouse has made me a little more willing to scroll down.)

Which is why I don't mind top posting as much as some do. Given that
so many of the USENET newbies are fairly clueless about the culture of
USENET and good quote editing is becoming a dying art, at least with
top posting I can quickly see what the new material is and quickly see
whether it's worth getting into. If I know the thread, the quotes don't
matter, but if I need them, THEN I can scroll down.

> ...that is to qoute a little bit, come with some comments, quote some


> more, and then write some comments to that as well. This can't at all
> be done in a top-posting.

Yep. As I said, the conversational feel.

> Top-postings became popular when the mass started using Internet and
> particularly mail.

And because the "easy-to-use" software that supports their access tends
to default to top posting mode.

Al Dunbar

unread,
May 1, 2001, 10:37:09 PM5/1/01
to

"Programmer Dude" <cjso...@mmm.com> wrote in message
news:3AEEDD86...@mmm.com...

> Tobias Brox wrote:
>
> > Anyway, here is my personal version. What is the reason to quote at
> > all? Consider it.
>
> To create a sense of conversational back and forth to a post.

<snip>

> Which is why I don't mind top posting as much as some do. Given that
> so many of the USENET newbies are fairly clueless about the culture of
> USENET and good quote editing is becoming a dying art, at least with
> top posting I can quickly see what the new material is and quickly see
> whether it's worth getting into. If I know the thread, the quotes don't
> matter, but if I need them, THEN I can scroll down.

But when you do, you will probably be glad to find that NONE of the previous
posters top-posted, otherwise you need to read (in order) lines 131-149,
121-130, 107-120, 99-106, ad nauseum (at least I get nauseous :-)

One place I do find top-posting workable is in a couple of vbscript ng's.
People generally submit fairly concise questions, and get a very short
top-posted answer from one (or perhaps two) of the resident gurus.


/Al

Programmer Dude

unread,
May 2, 2001, 12:43:10 PM5/2/01
to
Al Dunbar wrote:

>> Which is why I don't mind top posting as much as some do. [... With]


>> top posting I can quickly see what the new material is and quickly see
>> whether it's worth getting into. If I know the thread, the quotes
>> don't matter, but if I need them, THEN I can scroll down.
>
> But when you do, you will probably be glad to find that NONE of the

> previous posters top-posted,...

Yes, it's better that way, but it really doesn't bother me that much.
The quote level is usually helpful, and my onboard wetware is usually
up to the task of parsing what's there.

0 new messages