diff options
Diffstat (limited to 'Phone Book/Need for speed/task.html')
-rw-r--r-- | Phone Book/Need for speed/task.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Phone Book/Need for speed/task.html b/Phone Book/Need for speed/task.html new file mode 100644 index 0000000..927e294 --- /dev/null +++ b/Phone Book/Need for speed/task.html @@ -0,0 +1,24 @@ +<h5 style="text-align: center;" id="description">Description</h5> + +<p>Let's use faster methods to sort the list of numbers and to search in the list.</p> + +<p>As in the previous stage, you should first sort the list of phone numbers by the owner’s name and then search for the numbers of the 500 people from the list given in the first stage. Remember: to get decent and comparable results, you should put all the algorithms in the same initial conditions.</p> + +<p>For sorting, use the quick sort algorithm, and for searching, use the binary search algorithm.</p> + +<h5 style="text-align: center;" id="example">Example</h5> + +<p>Output all three approaches one after another and see which one is faster. The output example is shown below. Note that you can get totally different sorting and searching times!</p> + +<pre><code class="java">Start searching (linear search)... +Found 500 / 500 entries. Time taken: 1 min. 56 sec. 328 ms. + +Start searching (bubble sort + jump search)... +Found 500 / 500 entries. Time taken: 9 min. 15 sec. 291 ms. +Sorting time: 8 min. 45 sec. 251 ms. +Searching time: 0 min. 30 sec. 40 ms. + +Start searching (quick sort + binary search)... +Found 500 / 500 entries. Time taken: 1 min. 21 sec. 996 ms. +Sorting time: 1 min. 17 sec. 381 ms. +Searching time: 0 min. 4 sec. 615 ms.</code></pre>
\ No newline at end of file |