f



Help construct a tree 1 -> 1.1 -> 1.2 -> 2 -> 2.1 -> 2.1.1 etc HELP !!!!!!!

Borland Guru's I need help
I have a text file as follows:
1
2
1.1
1.1.1
3.3
2.3
etc
I cannot use a control active x tree
I need to read this file and 1 is a parent 1.1 is a child of parent 1
and
2 is a parent 2.3 is a child of parent 2 and construct in search a way
using arrays
or probably a recursive function
No xml parsing just read a file. Does any body have a function
0
Mos
5/5/2009 1:55:35 PM
comp.lang.pascal.delphi.misc 5769 articles. 1 followers. miniFAQ (1) is leader. Post Follow

5 Replies
1710 Views

Similar Articles

[PageSpeed] 19

"Mos" <lndebug@gmail.com> wrote in message
news:c1aaeb20-3c1f-408d-9986-bb8d28a87509@s31g2000vbp.googlegroups.com...

> I have a text file as follows:
> 1
> 2
> 1.1
> 1.1.1
> 3.3
> 2.3
> etc
> I cannot use a control active x tree
> I need to read this file and 1 is a parent 1.1 is a child of parent
> 1 and 2 is a parent 2.3 is a child of parent 2 and construct in
> search a way using arrays or probably a recursive function

You start with a linear function with considers each line in the file
in turn. For every line, a node is added to the tree under the right
parent node if you can find it, or at the top level if you can't.

Finding the parent node should be easy if the numbering is as you
show above. Node labels are a list of names and consecutive prefixes
(for 1.1.1, first 1, then 1.1) determine the path through the tree.

Is 3.3 a top level node because node 3 wasn't created first, or is
parent creation implicit?

Do you have a data structure for your tree?

Groetjes,
Maarten Wiltink

0
Maarten
5/6/2009 9:20:09 AM
"Maarten Wiltink" <maarten@kittensandcats.net> wrote in message 
news:4a01564a$0$184$e4fe514c@news.xs4all.nl...
> "Mos" <lndebug@gmail.com> wrote in message
> news:c1aaeb20-3c1f-408d-9986-bb8d28a87509@s31g2000vbp.googlegroups.com...

> Is 3.3 a top level node because node 3 wasn't created first, or is
> parent creation implicit?
>
> Do you have a data structure for your tree?

Presuming impicit creation one could use something as simple as

Type

pTreeNode = ^ tTreeNode;
tTreeNode = array of integer;

0
BRoberts
5/9/2009 1:50:05 AM
BRoberts wrote:
> "Maarten Wiltink" <maarten@kittensandcats.net> wrote in message 
> news:4a01564a$0$184$e4fe514c@news.xs4all.nl...
>> Is 3.3 a top level node because node 3 wasn't created first, or is
>> parent creation implicit?
>>
>> Do you have a data structure for your tree?
> 
> Presuming impicit creation one could use something as simple as
> 
> Type
> 
> pTreeNode = ^ tTreeNode;
> tTreeNode = array of integer;

I'm not seeing the tree.

-- 
Rob
0
Rob
5/9/2009 5:24:32 AM
"Rob Kennedy" <me3@privacy.net> wrote in message
news:76kicgF1dih7sU1@mid.individual.net...
> BRoberts wrote:
>> "Maarten Wiltink" <maarten@kittensandcats.net> wrote in message
>> news:4a01564a$0$184$e4fe514c@news.xs4all.nl...

>>> Do you have a data structure for your tree?
>>
>> Presuming impicit creation one could use something as simple as
>>
>> Type
>>
>> pTreeNode = ^ tTreeNode;
>> tTreeNode = array of integer;
>
> I'm not seeing the tree.

Every node contains a list of children. The first element is the
data. The remaining elements need to be cast to pointer to use
....Perhaps there's a better way.

Or you could do away with the pointers altogether and construct a
binary tree in a single array with the convention that the parent
node is at (index div 2), with left child node at 2*index and right
child node at succ(2*index). A neat trick that I've been taught
but never used, although I immediately recognised it when my mom
showed me an Ahnentafel.

Groetjes,
Maarten Wiltink


0
Maarten
5/9/2009 8:34:44 AM
"Rob Kennedy" <me3@privacy.net> wrote in message 
news:76kicgF1dih7sU1@mid.individual.net...
> BRoberts wrote:
>> "Maarten Wiltink" <maarten@kittensandcats.net> wrote in message 
>> news:4a01564a$0$184$e4fe514c@news.xs4all.nl...
>>> Is 3.3 a top level node because node 3 wasn't created first, or is
>>> parent creation implicit?
>>>
>>> Do you have a data structure for your tree?
>>
>> Presuming impicit creation one could use something as simple as
>>
>> Type
>>
>> pTreeNode = ^ tTreeNode;
>> tTreeNode = array of integer;
>
> I'm not seeing the tree.


Sorry I mistyped

pTreeNode = ^tTreeNode;
tTreeNode = array of pTreeNode;


0
BRoberts
5/10/2009 4:42:28 PM
Reply:

Similar Artilces:

how can i write this statement labels=[1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;]; in compress fo
How to write it in compact form to avoid repetition "shah " <shahkhn3@gmail.com> wrote in message <lodugh$8hr$1@newscl01ah.mathworks.com>... > How to write it in compact form to avoid repetition You'll find in this thread different solutions for similar question http://www.mathworks.fr/matlabcentral/newsreader/view_thread/335814 Bruno ...

LaTex equation numbering like 2.1, 2.2, also 2.0.1, 2.0,2, 2.1.1, etc
David Roach wrote: > Is there a simple command to have latex number > the equations by the section numbers automatically. > > David From the LaTeX Companion (what a wonderful book!) %%%%%%%%%%%%%%%%%%%%%% % number equations within sections % In preamble \makeatletter \@addtoreset{equation}{section} \makeatother \renewcommand{\theequation}{\thesection.\arabic{equation}} %%%%%%%%%%%%%%%%%%%%%% Numbers within sections...I use this all the time in articles. Even works with ******************* ******************* Brilliant. And then I got numbering within subsections by repe...

[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 3;....;n n n n n]
Hi, Anybody knows how to create this matrix but without using any loops? a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] Thank you. Hana. Hana wrote: > Hi, > Anybody knows how to create this matrix but without using any loops? > a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] HELP REPMAT - Randy Hana wrote: > > > Hi, > Anybody knows how to create this matrix but without using any > loops? > a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] > > Thank you. > Hana. Hope this isn't homework. >> repmat([1:n]'...

1 - 1, 1 -1, 1-1, 1
Hi, I have a question regarding lexical analysis. I recently came across a bug in our lexical analyser in phc (www.phpcompiler.org), that I am unsure how to solve. This is the problem: our current definition for integer constant looks something like INT ([1-9][0-9]*)|0 In particular, note that it does not allow for an (optional) "+" or "-" at the start of the integer. This means that the strings "1 - 1", "1 -1" and "1-1" all generate the same sequence of three tokens INT(1), OP(-), INT(1), for which the syntax analyser generates the subtr...

1.1.1.1 ?
hi my firewall logs dropped packets from an internal IP address trying to contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid IP? and what is port 9999?? thanks mike wrote: > hi > > my firewall logs dropped packets from an internal IP address trying to > contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid > IP? and what is port 9999?? > thanks These trojans *BlitzNet*, *Backdoor.Oracle*, *Backdoor.Spadeace* uses port 9999 -- S.S. "StarScripter" <Star@privacy.net> wrote in message news:<bv8ejj$p54t3$1@ID-185702.new...

plot 1, -1, 1, -1, -1
Hi, How to plot those numbers in a rectangle style? thanks x = linspace(-4*pi,4*pi,1000); y = sin(x); plot(x,sign(y)), axis([-12 12 -2 2]) PZ <patrick.zou@gmail.com> wrote in message <d64c545f-f2ac-4f87-af89-051bda896707@x6g2000vbg.googlegroups.com>... > Hi, > > How to plot those numbers in a rectangle style? > > thanks help stairs stairs([-1 1 -1 1 -1 1]) hth Jos ...

#1 #n+1 #2n+1 #2 #n+2 #2n+2 #3 #n+3 #2n+3 #n #2n #3n #1 #2 #3 #n #n+1 #n+2 #n+3 #2n #2n+1 100 Gbps aggregate stream of 64/66b words virtual lane markers virtual lane 1 virtual lane 2 virtual lan
#1 #n+1 #2n+1 #2 #n+2 #2n+2 #3 #n+3 #2n+3 #n #2n #3n #1 #2 #3 #n #n+1 #n+2 #n+3 #2n #2n+1 100 Gbps aggregate stream of 64/66b words virtual lane markers virtual lane 1 virtual lane 2 virtual lane 3 virtual lane n Simple 66-bit word level round robin distribution Transmit PM Transmit PM Receive PM Receive PM Transmit PC Receive PC 1 0.0 1.0 0.1 0.2 0.3 1.2 1.2 1.1 0.0 1.0 0.1 1.1 2.0 3.0 4.0 6.0 7.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 17.0 18.0 19.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 1...

Will Apache JServ 1.1.2-2 support JRE 1.3.1 ?
Hi Has anybody tried Apache 2.0.47 - Apache JServ 1.1.2-2 - JRE 1.3.1 combination?Will it work? Would like to know if there is any compatability problem before i begin to istall the above combination.pl reply Thanks csb ...

Will Apache JServ 1.1.2-2 support JRE 1.3.1 ?
Hi Has anybody tried Apache 2.0.47 - Apache JServ 1.1.2-2 - JRE 1.3.1 combination?Will it work? Would like to know if there is any compatability problem before i begin to istall the above combination.pl reply Thanks csb ...

(??] [1/4]
begin 644 TEST.txt M2&5L;&\@=&AI<R!I<R!A('1E<W0@9FEL92!F;W(@;7D@;F5W('!R;V=R86TN $+BXN+@`` ` end Posted Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.usenet.com ...

1.1, 1.2, 1.3 are all goners now
It seems, well, it doesn't seem but it is, well, it seems that the subject version of Workbenches won't be any more these, versions of Workbench, but versions of Amix. The Amiga's go for the Network. :-)) Have you seen that CDTV on amiga.jorg? That kind od schalametry for games, like some high tech heavily classic games will be played... Heyyyaaa!!! p.s. some piece of equipment, eh.. CD, floppy, installable HD, all, joysticks, joypads for CDTV, playing CDs and playing games. It's like you'll need a high class massive wood shelf for this, the CDs and for the - :( r...

[tao-users] The differences between TAO 1.4.1.2 and 1.5.1.0 #2
This is a multi-part message in MIME format. ------_=_NextPart_001_01C74A75.80E5ABB0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello all, =20 Could someone tell me where can I find a document which describes about the differences between TAO 1.4.1.2 and 1.5.1.0? =20 Thanks with regards, Shi Lei ------_=_NextPart_001_01C74A75.80E5ABB0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> &...

ACE 5.4.2 + TAO 1.4.2 client, ORBacus 4.1.2 NameService, and JACOrb 1.4.1 servants
Hi everyone, Background: ----------- I'm very new to CORBA, ACE & TAO. I'm trying to integrate with a 3rd party system which exposes a CORBA object model to clients. This system is composed of JACOrb 1.4.1 servers registering with an ORBacus 4.1.2 NameService. We've got existing software that uses ACE 5.4.2, and the 3rd party documentation mentions that people have used TAO (no version specified) previously to integrate with their system, so I'm trying out TAO 1.4.2 as a natural solution to the problem. Environment Specifics: ---------------------- - AC...

[ANN] gettext-2.0.1, gettext_activerecord-2.0.1, gettext_rails-2.0.1
Hi, Ruby-GetText-Package-2.0.1 and the families (gettext-2.0.1, gettext_activerecord-2.0.1 and gettext_rails-2.0.1) are now available. Ruby-GetText-Package is the library/tools for message localization. * gettext - Message localization libraries and tools for all kind of apps/libs. * gettext_activerecord - ActiveRecord Localization * gettext_rails - Rails support with gettext. Changes ------- * gettext-2.0.1 * Fixed bugs * doesn't work with ruby-1.8.5. [Reported by Dan Coutu] * GetText.locale= can't keep the locale. [Reported by Adam Ilan] * Break backward c...

[ANN] gettext-2.1.0, gettext_activerecord-2.1.0, gettext_rails-2.1.0
Hi, Ruby-GetText-Package-2.1.0 and the families (gettext-2.1.0, gettext_activerecord-2.1.0 and gettext_rails-2.1.0) are now available. Ruby-GetText-Package is the library/tools for message localization. * gettext - Message localization libraries and tools for all kind of apps/libs. * gettext_activerecord - ActiveRecord Localization * gettext_rails - Rails support with gettext. Changes ------- == gettext-2.1.0 * Implemented parsing of translator comments (GNU gettext feature) [by Vladimir Dobriakov] --- foo.rb def foo # TRANSLATORS: Comments for translators her...

Web resources about - Help construct a tree 1 -> 1.1 -> 1.2 -> 2 -> 2.1 -> 2.1.1 etc HELP !!!!!!! - comp.lang.pascal.delphi.misc

Construct (philosophy) - Wikipedia, the free encyclopedia
A construct in the philosophy of science is an ideal object , where the existence of the thing may be said to depend upon a subject's mind . ...

Transformers Construct-Bots on the App Store on iTunes
Get Transformers Construct-Bots on the App Store. See screenshots and ratings, and read customer reviews.

Create & Construct - Flickr - Photo Sharing!
nota 10 pro desenho mais feio visto pela humanidade

Mechanic Constructs Drivable "Upside Down Truck" - YouTube
Mechanic Constructs Drivable "Upside Down Truck" Barcroft Cars - The Home Of Amazing Car Stories Online SUBSCRIBE: http://bit.ly/1sHvkD5 A man ...

Winning buildings no mere construct
Winning buildings no mere construct

Tibet constructs 6000 low-rent housing units in 2013
Tibet constructs 6000 low-rent housing units in 2013 People's Daily Online These low-rent apartments, with an overall floor area of 300,000 ...

Google to use robot-crane hybrids to construct new ‘hackable’ Mountain View headquarters
According to a recent report from Architects Journal, Google is looking to use a robot-crane hybrids to assist in building its new Mountain View ...

Law Clerks Try To Construct Most Toolish Apartment On The Block
This all-lawyer house would make for a good reality TV show but is a terrible real-world idea.

Upworthy Constructs a Solid HR Story
We’re a little late to this Upworthy announcement , but we thought it was still worth highlighting because of the various ways the post diverges ...

Kenya: Somalia Rejects Kenya's Plan to Construct Wall Along Border
The Somali government has distanced itself from plans by Kenya to construct a barrier wall between the two countries.

Resources last updated: 2/6/2016 7:39:59 AM