-
October 8th, 2013, 11:41 PM
#1
Linear& Binary Search
Hi there,
Can I know what are the similarities of Linear search & Binary search techniques?
Thank you.....
-
October 11th, 2013, 04:04 PM
#2
Re: Linear& Binary Search
Originally Posted by Cruger
Can I know what are the similarities of Linear search & Binary search techniques?
The only similarity is that both are used for searching.
Key to the binary search is that data must be sorted. It allows a search to take place by successive halving resulting in a time complexity of O(log N) which is much faster than the O(N) of a linear search.
-
November 8th, 2013, 12:22 PM
#3
Re: Linear& Binary Search
Hi, exuse me, I am Belarusian men and my English very bad, but if you know about sort of list, please say about it.
-
November 12th, 2013, 06:15 PM
#4
Re: Linear& Binary Search
Originally Posted by Pavelx4y16
Hi, exuse me, I am Belarusian men and my English very bad, but if you know about sort of list, please say about it.
The quick and dirty way is to convert the list into an array which is then sorted using a standard array sorting algorithm. Then a new list is built from the sorted array and the old list is deleted.
This is for example how the Java standard library does it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|