100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CSE 2050 Time Complexities Test with Correct Verified Answers| Latest 2024

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
01-07-2024
Written in
2023/2024

Start at the beginning, sort the first 2 items in the list. Then, going through the list, add each next item into the sorted list, where it is supposed to be - Insertion sort Quick sort best case - O(nlogn) Quick sort average case - O(nlogn)

Show more Read less
Institution
CSE 2050
Course
CSE 2050









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE 2050
Course
CSE 2050

Document information

Uploaded on
July 1, 2024
Number of pages
5
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSE 2050 Time Complexities Test with Correct Verified Answers | Latest 2024 Start at the beginning, sort the first 2 items in the list. Then, going through the list, add each next item into the sorted list, where it is supposed to be - Insertion sort Quick sort best case - O(nlogn) Quick sort average case - O(nlogn) Quick sort worst case - O(n^2) Quick sort works best on - good pivots (close to median) Quick sort works worst on - bad pivots (close to edges) quick sort properties - dependent on pivots, recursive Pick a random ele ment as a pivot, move everything less than that element to it's left, and everything greater to it's right. Then, repeat this for the left and the right halves, picking a pivot and moving things around accordingly - quick sort Merge sort best case - O(nlo gn) Merge sort average case - O(nlogn) Merge sort worst case - O(nlogn) Merge sort works best when - already almost sorted list merge sort works worst on - reverse order list merge sort properties - recursive divide a list continuously into smaller s ublists, until you end with just one element in a list. merge sublists, sorting while you do, until you end up with just one sorted list - merge sort Cuts a SORTED list in half, checks the edge of each half to see if it matches the item searching for. The n cuts the half where the item we want would be, and continuous cutting in half until we find the item. - Binary search Binary search best case - O(1) Binary search average case - O(log n) Binary search worst case - O(log n) Loops through a list, once you find the element you are searching for you stop - linear search

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
QUINTER New York College Of Dentistry
View profile
Follow You need to be logged in order to follow users or courses
Sold
342
Member since
2 year
Number of followers
104
Documents
38404
Last sold
2 days ago

3.4

57 reviews

5
25
4
8
3
7
2
1
1
16

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions