Determine the nth element in order


Problem

For efficiency, we're adding a "size" parameter to each node of a Binary Search Tree, similar to the way we added a height parameter to each node for the AVL tree. This size is stored in the node and not calculated so accessing it is constant time. We would like you to write a function which will determine the "Nth" element in order. That is, if the in-order traversal of the tree is "2,3,5,6,8,9" the 3rd element is 5, the 6th element is 9, etc. You function should be a member of the BST class and should have the form "T BST::findNth(int n)".

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Determine the nth element in order
Reference No:- TGS03256957

Expected delivery within 24 Hours