Exam 7 CMSC420

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:26 PM on 5/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

What is the essential amortized cost of disjoint set operations?

O(1)

2
New cards

What is the time complexity of kruskals?

O(E) or O(E acker(V))

3
New cards

How does kruskals work?

You have edges in sorted order; go through from least to greatest and check if the two current nodes aren’t in the same component, if they are union them and add the edge

4
New cards

How does weighted union work?

Put the tree with less nodes under the tree with more nodes

5
New cards

How does a hash function work with a hash table?

Its output must be Zm where m is the number of slots

6
New cards

What is closed adressiong/open hashing?

Storing with a data structure, used by java

7
New cards

What is open adressing/closed hashing?

Using probing, used by python

8
New cards

What is quadratic probing?

Try h(x) + i² mod m for i = 0, 1, 2. Benefit is it helps avoid clusters, but not checking every spot. Linear probing is vice vers

9
New cards

What is double hashing?

Try T[h(x) + ig(x) mod m] where g is another hash function

10
New cards

What is robinhood hashing?

Keep track of how many steps we are away from h(x), if we collide, check to see if we’re more steps than away than the current. If so put it there, and move that element

11
New cards

What is the load factor?

n/m where n= # of values stored and m = total size of table

12
New cards

When do you reset m and to what value?

When it’s outside of the range ymin ymax EXCLUSIVE, reset to ceiling(2n / (ymin + ymax))

13
New cards

What is time for inserting and hashing into a hash table

O(1)