Linked list resolution
-
Basic Concepts • Sequential search: O(n) • Binary search: O(log2n) Requiring several key comparisons before the target is found • Search complexity: Size 16 50 256 1,000 10,000 100,000 1,000,000 Binary 4 6 8 10 14 17 20 Sequential (Average) 8 25 128 500 5,000 50,000 500,000 Sequential (Worst Case) 16 50 256 1,000 10,000 100,000 1,000,000 • Is there a search algorithm whose complexity is O(1)? • Is there a search algorithm whose complexity is O(1)? YES.
54p unknownno30 14-11-2012 65 4 Download