Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Exam (elaborations)

Data Structures and Algorithms Runtime Questions with Answers

Rating
-
Sold
-
Pages
2
Grade
A+
Uploaded on
18-08-2024
Written in
2024/2025

Data Structures and Algorithms Runtime Array - Answer- Access: O(1) Search: O(n) Insertion: O(n) Delete: O(n) Stack - Answer- Access: O(n) Search: O(n) Insertion: O(1) Delete: O(1) Linked List (Singly and Doubly) - Answer- Access: O(n) Search: O(n) Insertion: O(1) Delete: O(1) Hash Table - Answer- O(1) for everything, but has no sorting Binary Search Tree - Answer- Average O(log(n)) for everything, worst O(n) for everything Self-Balancing Trees (Red-Black, B, Splay, AVL) - Answer- Average and worst O(log(n)) for everything Quick Sort - Answer- Best: O(nlogn) Average: O(nlogn) Worst: O(n^2) Space Worst: O(logn) Merge Sort - Answer- Best: O(nlogn) Average: O(nlogn) Worst: O(nlogn) Space Worst: O(n) Bubble Sort - Answer- Best: O(n) Average: O(n^2) Worst: O(n^2) Space Worst: O(1) Insertion Sort - Answer- Best: O(n) Average: O(n^2) Worst: O(n^2) Space Worst: O(1) Selection Sort - Answer- Best: O(n^2) Average: O(n^2)

Show more Read less
Institution
Data Structures And Algorithms Runtime
Course
Data Structures and Algorithms Runtime

Content preview

Data Structures and Algorithms
Runtime
Array - Answer- Access: O(1)
Search: O(n)
Insertion: O(n)
Delete: O(n)

Stack - Answer- Access: O(n)
Search: O(n)
Insertion: O(1)
Delete: O(1)

Linked List (Singly and Doubly) - Answer- Access: O(n)
Search: O(n)
Insertion: O(1)
Delete: O(1)

Hash Table - Answer- O(1) for everything, but has no sorting

Binary Search Tree - Answer- Average O(log(n)) for everything, worst O(n) for
everything

Self-Balancing Trees (Red-Black, B, Splay, AVL) - Answer- Average and worst
O(log(n)) for everything

Quick Sort - Answer- Best: O(nlogn)
Average: O(nlogn)
Worst: O(n^2)
Space Worst: O(logn)

Merge Sort - Answer- Best: O(nlogn)
Average: O(nlogn)
Worst: O(nlogn)
Space Worst: O(n)

Bubble Sort - Answer- Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space Worst: O(1)

Insertion Sort - Answer- Best: O(n)
Average: O(n^2)
Worst: O(n^2)
Space Worst: O(1)

Selection Sort - Answer- Best: O(n^2)

Written for

Institution
Data Structures and Algorithms Runtime
Course
Data Structures and Algorithms Runtime

Document information

Uploaded on
August 18, 2024
Number of pages
2
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

R156,82
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
Freshy Oxford University
Follow You need to be logged in order to follow users or courses
Sold
59
Member since
2 year
Number of followers
4
Documents
6982
Last sold
3 weeks ago

3,6

10 reviews

5
3
4
4
3
1
2
0
1
2

Trending documents

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT 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