![]() |
| | #1 | |
| UT2004 Addict Join Date: Dec 2004
Posts: 645
| Question 39: Quicksort vs Linear Search Quote:
| |
| Kleid-0 is offline | |
| | #2 |
| Crazy Fool Join Date: Jan 2003 Location: Canada
Posts: 2,596
| A linear search is O(n). Quick sort is O(n log(n)) [in its best case]. Bubble sort is O(n^2). Which is the shortest of those three? O(n) Whether your searching or sorting is irrelevant. The point of the question is to see which algorithm runs in the fastest time.
__________________ jeff.bagu.org - Terrain rendering and other random stuff |
| Perspective is offline | |
| | #3 |
| It's full of stars Join Date: Aug 2001
Posts: 4,833
| <pedant>Without a statement that says the dataset is not in order, the question is meaningless.</pedant>
__________________ Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream. |
| adrianxw is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contest Results - May 27, 2002 | ygfperson | A Brief History of Cprogramming.com | 18 | 06-18-2002 01:27 PM |
| Search Engines :: Winsock | kuphryn | Windows Programming | 3 | 06-18-2002 12:31 PM |
| Again Character Count, Word Count and String Search | client | C Programming | 2 | 05-09-2002 11:40 AM |
| Linear search and 2d arrays? | sven | C Programming | 0 | 02-08-2002 05:26 AM |
| Linear Search: the recursive way. | Nutshell | C Programming | 7 | 01-15-2002 03:15 AM |