Notices
Results 1 to 1 of 1

Thread: Algorithm for 2nd smallest value w/ n + ceiling(lg n) - 2

  1. #1 Algorithm for 2nd smallest value w/ n + ceiling(lg n) - 2 
    New Member
    Join Date
    Sep 2008
    Location
    Montreal, Canada
    Posts
    4
    How do you get an algorithm for the second smallest value that for the worst case completes in: n + ceiling( lg n ) - 2 ?

    The best algorithm I could get was 2n - 3 in the worst case, and it's too slow.

    (For anyone who is interested tt is the question 9.1-1 from the textbook Introduction to Algorithms, second edition, by T. Cormen, C. Leiserson, R. Rivest, C. Stein, McGraw Hill.)


    Reply With Quote  
     

  2.  
     

Bookmarks
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
  •