VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time ]
Subject: spurningar


Author:
No name
[ Next Thread | Previous Thread | Next Message | Previous Message ]
Date Posted: 15:45:59 05/02/04 Sun

hall
hrna eru nokkrar spurningar
1.
Er nokku fyrsti hntur tendum lista haushntur nema
hann s "dummy node"? semsagt ef enginn dummy node
bara hausbendir fyrsta hnt.


2.
ef maur tlar a taka t hnt nr. N r
tengdum lista hvort notar maur
a) void remove(node *h, int N)
eda
b) void remove(node *&h, int N)
g hlt a maur yrfti ekki reference v bendirinn
aferinni bendir raun sama sta og bendirinn
main.
???

3.er ekki
typedef node *link
link x

sama og
node *x

4.
hrna er afer bls 247 prog. 5.15
hvernig breytir maur essu in ea postorder?

preorder traversal (nonrecursive)

void traverse (link h, void visit(link))
{STACK s(max);
s.push(h);
while (!s.empty())
{ visit (h=s.pop());
if(h->r!=0) s.push(h->r);
if(h->l!=0) s.push(h->r);
}
}


eins og g skil a sem stendur textanum
a vera ng a gera

if(h->r!=0) s.push(h->r);
visit (h=s.pop());
if(h->l!=0) s.push(h->r); fyrir inorder

og

if(h->r!=0) s.push(h->r);
if(h->l!=0) s.push(h->r);
visit (h=s.pop()); fyrir postorder

(sbr 5.14, recursive fall)

en s ekki a a gti gengi.

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Replies:
Subject Author Date
Re: spurningarNo name16:31:47 05/02/04 Sun


Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT+0
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.