typo! floor(n/2/+1) ==> floor((n/2/+1)/2) ......... Satya
On Fri, Aug 6, 2010 at 5:27 PM, Satya <satya...@gmail.com> wrote: > u need to write a recursive function. > All leaf nodes in complete BST are from n/2+1....n. > n/2+1 element will be the beginning element(least left child) for our > resultant sorted array. U can get the parent of the element by doing the > floor(n/2/+1), get the right child of the parent by 2*(floor(n/2/+1))+1, do > it recursively for its parent and so ... on till the parent index is 0 > > ......... > Satya > > > > On Fri, Aug 6, 2010 at 3:37 PM, sharad kumar <aryansmit3...@gmail.com>wrote: > >> perform inorder traversal.......and store it in same array....... >> >> >> On Thu, Aug 5, 2010 at 7:10 PM, AlgoBoy <manjunath.n...@gmail.com> wrote: >> >>> sort a BST represented like an array...(similar to representation of >>> HEAP) >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algoge...@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >>> >> >> >> -- >> yezhu malai vaasa venkataramana Govinda Govinda >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.