| | |
binary tree traversal ..
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 147
Reputation:
Solved Threads: 20
I can just explain you how to code on code it in any language of your desire
Algorithm Suggest: -
i) visit the left Subtree
ii) visit the Node
iii) visit the right Subtree
You are interested in making the Non Recursive version of the above traversal. You can make it easily... if you know how recursion attempts the problem, infact recusion is using the implicit stack. So you might use an explicit stack to tackle the same problem
. My Suggessions are first try to solve it by hand then you'll get the idea what infact you are doing then try to code the logic.
Give me your code of recursive Version I'll give you mine (non recursive version :d).......
Hope you get the basic idea........
Algorithm Suggest: -
i) visit the left Subtree
ii) visit the Node
iii) visit the right Subtree
You are interested in making the Non Recursive version of the above traversal. You can make it easily... if you know how recursion attempts the problem, infact recusion is using the implicit stack. So you might use an explicit stack to tackle the same problem
. My Suggessions are first try to solve it by hand then you'll get the idea what infact you are doing then try to code the logic.Give me your code of recursive Version I'll give you mine (non recursive version :d).......
Hope you get the basic idea........
Last edited by Laiq Ahmed; Jul 13th, 2006 at 1:41 am.
![]() |
Similar Threads
- Help for Binary Tree Traversal for infix to postfix conversion (C++)
- complete binary tree using an array help (C++)
- Binary Tree Traversal (C)
- C++ complete binary tree using an array. Unexpected end file (C++)
Other Threads in the C++ Forum
- Previous Thread: stupid string replace! (c++)
- Next Thread: Extracting folder information with c++
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data delete deploy desktop directshow dll download dynamic encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





