Recursive function, Data Structure & Algorithms

The location of a node in a binary search tree is defined as a string such as LLRRL, which represents the node that you find by starting at the root, and traversing Left, traverse Left, traverse Right, traverse Right, and traverse Left.   Write a function to print a path to some target 'x' based on the direction from the root to the target.  For example, in the tree above, the path from 65 to 52 is LRR. Hint: use a stack to store the path.

161_Recursive function to determine if a binary tree.png

Write a recursive algorithm to count the number of right children in a binary search tree.

Write the method levelCount whose header is given below. Method levelCount returns the number of nodes on the specified level.

2396_Recursive function to determine if a binary tree1.png

Posted Date: 4/2/2013 1:23:31 AM | Location : United States

Related Discussions:- Recursive function, Assignment Help, Ask Question on Recursive function, Get Answer, Expert's Help, Recursive function Discussions

Write discussion on Recursive function
Your posts are moderated
Related Questions
Give the example of bubble sort algorithm For example List: - 7 4 5 3 1. 7 and 4 are compared 2. Since 4 3. The content of 7 is now stored in the variable which was h

Q. What do you understand by the tree traversal? Write down the procedure for traversing a binary tree in preorder and execute it on the following tree.    Ans: Th

Program: Program segment for insertion of an element into the queue add(int value) { struct queue *new; new = (struct queue*)malloc(sizeof(queue)); new->value = val

Q. Suggest a method of implementing two stacks in one array such that as long as space is there in an array, you should be capable to add an element in either stack. Using proposed

Using Assertions When writing code, programmer must state pre- and subtle post conditions for public operations, state class invariants and insert unreachable code assertions a

Algorithm for deletion of any element from the circular queue: Step-1: If queue is empty then say "queue is empty" & quit; else continue Step-2: Delete the "front" element

Write an algorithm for binary search. What are its limitations? .

Q. Construct a complete binary tree with depth 3 for this tree which is maintained in the memory using the linked representation. Make the adjacency list and adjacency matrix for t

Almost Complete Binary Tree :-A binary tree of depth d is an almost whole binary tree if: 1.Any node and at level less than d-1 has two children. 2. for any node and in the tree wi

Which data structure is used for implementing recursion Stack.