Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
110 views

(191775152) Lab Report Example

This document summarizes an algorithms analysis lab where the student implemented and analyzed the time complexities of linear search, binary search, and insertion sort. The student found that linear search has an O(n) complexity, binary search has an O(log n) complexity, and insertion sort has an O(n^2) complexity. The student also notes they could have used a recursive approach for binary search but could not figure it out within the constraints of the lab.

Uploaded by

bella_duane
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views

(191775152) Lab Report Example

This document summarizes an algorithms analysis lab where the student implemented and analyzed the time complexities of linear search, binary search, and insertion sort. The student found that linear search has an O(n) complexity, binary search has an O(log n) complexity, and insertion sort has an O(n^2) complexity. The student also notes they could have used a recursive approach for binary search but could not figure it out within the constraints of the lab.

Uploaded by

bella_duane
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ALGORITHM ANALYSIS PT 2 (THEORY) LAB # 4

By Isabella Duane Ia166

On my honor, as a Mississippi State University student, I have neither given nor received unauthorized assistance on this academic work.

CSE1384 Intermediate Computer Programming Class Section #12 Rikk Anderson Feb. 28, 2014

Analysis and Conclusions

The main goals of this class were to implement linear search, binary search, insertion sort and analize their complexities. Linear search has order of n time complexity, as analized below.

Binary search has order of

time complexity, as analized below.

Insertion Sort has order of n time complexity, as analized below.

For the binary_search procedure, I could have used a recursive algorithm for more clarity on the code, but I could not figure it out, in class, how to do it using only two parameters. Later, I could think that we could have two binary_search procedures, where the one required (with two parameters) calls the other one.

You might also like