CMSC132 Exam 3 Runtimes and Formulas

0.0(0)
studied byStudied by 20 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/22

flashcard set

Earn XP

Description and Tags

No joke this is the 4th knowt set I've created in on week...should I get help? Also I may have done some things wrong so pls lmk if there are any mistakes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

23 Terms

1
New cards

Lookup and Insertion on an Unordered Linked List

n+1 = O(n)

2
New cards

Insertion on an Unordered Linked List

O(1)

3
New cards

Lookup and Deletion on an Unordered Linked List

n+1 = O(n)

4
New cards

Deletion on an Unordered Linked List

O(1)

5
New cards

Indexing on an Unordered Linked List

O(n)

6
New cards

Search or Lookup on a Balanced BST

O(log(n))

7
New cards

Search or Lookup on a Degenerate BST

O(n)

8
New cards

Lookup and Insertion on a Balanced BST

O(log(n))

9
New cards

Lookup and Insertion on a Degenerate BST

O(n)

10
New cards

Lookup and Deletion on a Balanced BST

O(log(n))

11
New cards

Lookup and Deletion on a Degenerate BST

O(n)

12
New cards

Number of Elements in a Perfect Binary Tree of Height h

2^(h+1)-1

13
New cards

Location Formula for Parent of i in a Binary Tree

floor((i-1)/2)

14
New cards

Location Formula for Left Child of i in a Binary Tree

2i+1

15
New cards

Location Formula for Right Child of i in a Binary Tree

2i+2

16
New cards

Height of Heap

O(log(n))

17
New cards

How much memory space will be used to store an undirected graph that has n vertices and m edges using an adjacency list?

O(m)

18
New cards

Min Heap Insertion

O(log(n))

19
New cards

Finding Maximum Element in Min Heap

O(n)

20
New cards

Lookup and Insertion on an Ordered Linked List

O(n)

21
New cards

Insertion on an Ordered Linked List

O(n)

22
New cards

Lookup and Deletion on an Ordered Linked List

O(n)

23
New cards

Deletion on an Ordered Linked List

O(n)