Results 1 to 4 of 4
Thread: binary and lineary search
- 03-27-2011, 09:43 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 2
- Rep Power
- 0
binary and lineary search
consider an array storing the values 1 through 1000 in that order. Identify the sequence of probes that would be made in searching for the value 487 for both the linear and binary search. How many probes are there for the linear and binary search?
That is the question. I have a binary and linear search programs but I cant seem to add a counter.
- 03-27-2011, 09:47 PM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Is this a homework assignment?
If it is, instead of my giving you the answer, I will direct you to learn the difference between linear and binary.
algorithm - What is the difference between Linear search and Binary search? - Stack Overflow
After reading and understanding the difference this problem is trivial.(this can be done very easily with pen and paper)
- 03-28-2011, 05:04 AM #3
Member
- Join Date
- Mar 2011
- Posts
- 2
- Rep Power
- 0
it is a homework problem and i did work it out on paper and got 12 as the answer for the binary search but i just want to make sure that its correct
- 03-28-2011, 05:38 AM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Similar Threads
-
Binary Search
By cengho in forum Java AppletsReplies: 4Last Post: 12-24-2010, 10:26 AM -
Binary Search Help
By Plissken in forum New To JavaReplies: 2Last Post: 03-13-2010, 10:34 AM -
Binary search tree search method
By chopo1980 in forum New To JavaReplies: 2Last Post: 12-10-2009, 01:42 AM -
Binary Search in Java
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:43 PM -
binary search
By tranceluv in forum New To JavaReplies: 10Last Post: 01-14-2008, 07:13 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks