Recursive binary search

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Mar 2009
Posts: 40
Reputation: srk619 is an unknown quantity at this point 
Solved Threads: 0
srk619 srk619 is offline Offline
Light Poster

Recursive binary search

 
0
  #1
Apr 6th, 2009
does anyone know how to test a recursive bianry search to check if it works
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 20
Reputation: Nine Tails is an unknown quantity at this point 
Solved Threads: 4
Nine Tails Nine Tails is offline Offline
Newbie Poster

Re: Recursive binary search

 
0
  #2
Apr 6th, 2009
I think that you are asking for help in seeing that your function actually goes through all the steps of binary search on a list. Why don't you create a small test list and place a print statement in your code that displays the sublist that is sent back to the function at each recursive call. Since the list is small you can easily tell what the proper search path should be. If the output is what you should be seeing then it is likely that your code works.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 15
Reputation: jaux is an unknown quantity at this point 
Solved Threads: 2
jaux's Avatar
jaux jaux is offline Offline
Newbie Poster

Re: Recursive binary search

 
0
  #3
Apr 6th, 2009
You might find this is interesting: http://www.paulbutler.org/archives/p...th-decorators/
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 40
Reputation: srk619 is an unknown quantity at this point 
Solved Threads: 0
srk619 srk619 is offline Offline
Light Poster

Re: Recursive binary search

 
0
  #4
Apr 8th, 2009
ur link didnt help but ive solved it thx
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC