+ Reply to Thread
Results 1 to 3 of 3

Thread: Find median of elements of a BST in O(log n)

  1. #1
    TopGun Guest

    Find median of elements of a BST in O(log n)

    Find median of elements of a Binary Search tree in O(log n)

  2. #2
    game.iiith Guest
    You can't, until you have additional information regarding the number of elements in the subtree rooted at every node.

    Avi
    Avi Dullu's Code Arena

  3. #3
    jalajb2k7 Guest
    convert BST TO DLL and then find the middle element... but its O(n)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Median of Five numbers
    By TopGun in forum Google
    Replies: 2
    Last Post: 2nd January 2011, 11:45
  2. Find median of two Arrays
    By TopGun in forum Algorithm/Data Structure Questions
    Replies: 1
    Last Post: 25th June 2010, 23:22
  3. Find median of a binary search tree
    By Surfer in forum Algorithm/Data Structure Questions
    Replies: 1
    Last Post: 26th March 2010, 11:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts