SEARCH EXPERIMENT
Search Algorithms
(download and run Search app from 5.7)
N
Search 1 Runtime
Search 2 Runtime
1000
301 ms
12 ms
2000
803 ms
14 ms
3000
1530 ms
24 ms
4000
2452 ms
25 ms
5000
3874 ms
35 ms
6000
5353 ms
39 ms
7000
7500 ms
48 ms
8000
9180 ms
36 ms
9000
12144 ms
46 ms
10000
14966 ms
45 ms
Which search is Linear Search and which is Binary Search?
The linear search method is method 1 and the binary search method is method 2. I know this because binary search takes much less time to search through a sorted list and in each trial method 2 takes much less time to search than method 1.
SORT EXPERIMENT
Sort Algorithms
(download and run Sort app from 5.7)
N
Sort 1 Runtime
Sort 2 Runtime
Sort 3 Runtime
10
95 ms
47 ms
32 ms
20
405 ms
51 ms
97 ms
30
933 ms
87 ms
102 ms
40
1702 ms
69 ms
172 ms
50
2349 ms
93 ms
205 ms
60
3559 ms
96 ms
227 ms
70
4678 ms
83 ms
295 ms
80
5896 ms
92 ms
320 ms
90
7802 ms
94 ms
396 ms
100
9426 ms
100 ms
476 ms
Which one is Bubble Sort, Merge Sort, or Bucket Sort?
Sorting method number one is bubble sort. I know this because bubble sort is the method that takes the longest time to sort a set of data, and method one took the longest in every trial. Merge sort is method number three because i know that merge sort takes less time than bubble sort but more time than bucket sort, and it took an amount of time in the middle of methods one and two in every trial. Bucket sort is method number three because it takes less time than both bubble and merge sorts. In every trial, method three took the least time.
Portfolio Reflection Questions
Make a copy of this document in your Portfolio Assignments folder and answer these questions in the spaces below. Once complete, turn in this assignment according to the steps given by your teacher.
5.7 Analyzing Algorithms Curriculum Page
Answer the following questions:
1. Present the results and the analysis you did for each of the experiments in this lesson, -- i.e., the table of running times you observed, the graphs you created, and the conclusions you reached regarding the searching algorithms and sorting algorithms. Provide a clear description, referring to your graphs and your tabulated data, to explain how you arrived at your conclusions.
Answer
Sort Algorithms
N
Sort 1 Runtime
Sort 2 Runtime
Sort 3 Runtime
10
95 ms
47 ms
32 ms
20
405 ms
51 ms
97 ms
30
933 ms
87 ms
102 ms
40
1702 ms
69 ms
172 ms
50
2349 ms
93 ms
205 ms
60
3559 ms
96 ms
227 ms
70
4678 ms
83 ms
295 ms
80
5896 ms
92 ms
320 ms
90
7802 ms
94 ms
396 ms
100
9426 ms
100 ms
476 ms
I concluded that method one is bubble sort, method two is bucket sort, and method three is merge sort. I came to this conclusion because, based on the video lesson, bubble sort takes more time that both bucket and merge sort. Method one reflects this in the table. Method 2 is bucket sort because it is more efficient than both merge and bubble sorts, which is reflected as method 2 in the table. I concluded that merge sort is method 3 because it takes more time than bucket but less than bubble, which is reflected as method 3 on the graph.
Search Algorithms
(download and run Search app from 5.7)
N
Search 1 Runtime
Search 2 Runtime
1000
301 ms
12 ms
2000
803 ms
14 ms
3000
1530 ms
24 ms
4000
2452 ms
25 ms
5000
3874 ms
35 ms
6000
5353 ms
39 ms
7000
7500 ms
48 ms
8000
9180 ms
36 ms
9000
12144 ms
46 ms
10000
14966 ms
45 ms
I came to the conclusion that method one is the linear, or sequential, search method and method 2 is the binary search method. I came to this conclusion based upon the data that i collected from the experiment. Because binary search is much more efficient than linear search, the table tells me that binary search is method number two because in every trial it took much less time to complete than method one did.