Exam 2 Cram

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 22

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

23 Terms

1

BST add()

Average and Best: O(log n)
Worst: O(n)

New cards
2

BST remove()

Average and Best: O(log n)
Worst: O(n)

New cards
3

BST search()

Average and Best: O(log n)
Worst: O(n)

New cards
4

BST height()

Average and Best: O(log n)
Worst: O(n)

New cards
5

Heap insert()

Always O(log n)

New cards
6

Heap remove():

Always O(log n)

New cards
7

Heap heapify()

O(log n) for the first element; O(n) for the full heap

New cards
8

Heap BuildHeap():

O(n) always

New cards
9

AVL add()

O(log n) always

New cards
10

AVL Remove()

O(log n) always

New cards
11

AVL search()

O(log n) always

New cards
12

AVL rotation() and height()

O(1) always

New cards
13

AVL traversal

O(n) always

New cards
14

2-4 Tree Add()

Always O(log n)

New cards
15

2-4 Tree Remove()

Always O(log n)

New cards
16

2-4 Tree search() and height() and promote()

O(log n) always for all three

New cards
17

HashMap put()

Best and Average: O(1)
Worst: O(n)

New cards
18

HashMap get()

Best and Average O(1):
Worst: O(n)

New cards
19

HashMap remove()

Best and Average O(1):
Worst: O(n)

New cards
20

HashMap (external chain is SLL):

add(): O(1) or O(n) depending on if you need to search a list for duplicates or just add at the head
remove(): O(1) if just one element in a bucket, O(n) if more
get(): O(1) if just one element, O(n) if more

New cards
21

HashMap (external chain is BST):

add(): O(log n), unless degen then O(n)
remove(): O(log n) if balanced; O(n) if unbalanced as height is linear
get(): O(log n) if balanced; O(n) if unbalanced as height is linear

New cards
22

HashMap (external chain is AVL):

O(log n) for all cases of add, remove, and get

New cards
23

SkipList

O(log n) always for add removal and search if its a fair coin
O(n) if its not

New cards

Explore top notes

note Note
studied byStudied by 32 people
605 days ago
5.0(1)
note Note
studied byStudied by 94 people
1011 days ago
5.0(1)
note Note
studied byStudied by 17 people
825 days ago
5.0(1)
note Note
studied byStudied by 1 person
784 days ago
5.0(1)
note Note
studied byStudied by 37 people
659 days ago
5.0(1)
note Note
studied byStudied by 14 people
911 days ago
5.0(1)
note Note
studied byStudied by 9 people
888 days ago
5.0(1)
note Note
studied byStudied by 5422 people
705 days ago
4.6(34)

Explore top flashcards

flashcards Flashcard (49)
studied byStudied by 6 people
834 days ago
5.0(1)
flashcards Flashcard (32)
studied byStudied by 5 people
489 days ago
5.0(1)
flashcards Flashcard (72)
studied byStudied by 35 people
90 days ago
5.0(1)
flashcards Flashcard (34)
studied byStudied by 9 people
366 days ago
5.0(1)
flashcards Flashcard (24)
studied byStudied by 62 people
561 days ago
4.5(2)
flashcards Flashcard (51)
studied byStudied by 1 person
48 days ago
5.0(3)
flashcards Flashcard (100)
studied byStudied by 4 people
449 days ago
5.0(1)
flashcards Flashcard (423)
studied byStudied by 2 people
34 minutes ago
5.0(1)
robot