473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Tricky postorder without recursion

2
I am sorry if this was allready asked or discussed, please redirect me.

I have to make the program of postorder traversal of the binary search tree NOT using recursion. I have found many solutinos using recursion but I can't figure 1 without recursion. Can you help me and tell me the code? Please.
With recursion:
Expand|Select|Wrap|Line Numbers
  1. void postorder(struct node *bt)
  2. {
  3. if(bt!=NULL)
  4. {
  5. postorder(bt->left);
  6. postorder(bt->right);
  7. printf("[ %d ]\t",bt->data);
  8. }
  9. else
  10. return ;
  11. }
Without recursion:
?
Nov 3 '06 #1
2 3209
mdeni
2
Thank you for the replies! Useless...
Nov 12 '06 #2
r035198x
13,262 8TB
Thank you for the replies! Useless...
http://eternallyconfuzzled.com/tuts/bst1.html#traverse
Nov 12 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Timothy Madden | last post by:
Hello I have a linked list of object of a class. I thought it would be nice to have the destructor delete the whole list when I delete just the first element. I don't want to recursivly destroy...
92
by: Raghavendra R A V, CSS India | last post by:
hie.. Do any one knows how to write a C program without using the conditional statements if, for, while, do, switch, goto and even condotional statements ? It would be a great help for me if...
17
by: subnet | last post by:
I'm not a C expert, but I've seen this topic discussed in the newsgroup several times. What's the deal with writing such programs? Why are they considered so interesting? Thanks
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
9
by: nishit.gupta | last post by:
Can somebody please help me for algorithm for postorder bst traversal without recursion. It should use stack. i am not able to implement it. thnx
17
by: AceKnocks | last post by:
I have been given this interface, interface BinarySearchTree { public void insert(Integer data); public int size(); public int height(); public boolean contains(Integer target); }
1
by: katdaniel16 | last post by:
how to construct a binary tree from inorder and postorder using the c programming language.. pseudocode will do.. thanks
0
by: prabhjots | last post by:
Hi All, I wanted to generate an XML with a help of a support table. Table fields are Node, Type(leaf/Node), from, to , Attribute.. I have successfully achieved this using recursion, but...
35
by: Muzammil | last post by:
int harmonic(int n) { if (n=1) { return 1; } else { return harmonic(n-1)+1/n; } } can any help me ??
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.