CMSC420 Exam 5

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

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:51 PM on 4/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

20 Terms

1
New cards

How does splay first insertion work?

Splay(x), get either IOP or IOS as root, insert x before/after root by moving it down based on IOP or IOS

<p>Splay(x), get either IOP or IOS as root, insert x before/after root by moving it down based on IOP or IOS</p>
2
New cards

How does splay first deletion work?

Splay(x) to bring it to the root, if it has two subtrees splay in either of them to get IOS/IOP as root of that tree, promite it to replace x

<p>Splay(x) to bring it to the root, if it has two subtrees splay in either of them to get IOS/IOP as root of that tree, promite it to replace x </p>
3
New cards

How does splay second delete work?

Delete regularly and splay the parent

4
New cards

What is time complexity of operations?

Amortized per operation it’s logn, worst case n

5
New cards

What does m mean in an EKD tree?

Max number of points in a leaf node

6
New cards

What direction do you go when inserting if the coordinate matches the splitting node?

Go right

7
New cards

How generally does splitting work?

Choose a coordinate to split by, cycle sort by that coordinate, floor((m + 1)/ 2) go left, the rest go right (the right gets one more if it’s uneven)

8
New cards

How does cycle split work?

If at the root split by the first coordinate, if it a non-root split by the coordinate after the coordinate which the parent split by

9
New cards

How does spread split work?

Calculate spread of each coordinate, split by the max spread. if there’s a tie go with the left most coordinate

10
New cards

What is the splitting value?

The median of the splitting coordinate

11
New cards

How does deleting from a EKD tree work?

Search for point, delete it, if the node becomes empty, remove it’s parent splitting node and promote the other child

<p>Search for point, delete it, if the node becomes empty, remove it’s parent splitting node and promote the other child </p>
12
New cards

When you delete, how do you update the bounding box?

Recalculate the bounding box at the leaf, then recursively go to the root taking the rectangle union between the two children

13
New cards

How does the range query work?

If we’re at a leaf, check which points are in the range, other wise check if left node BB overlaps with rectangle, if they do go there, then check right

14
New cards

How can you tell if two rectangles overlap?

If A.max >= B.min and B.max >= A.min for both y and x coordinate

<p>If A.max &gt;= B.min and B.max &gt;= A.min for both y and x coordinate</p>
15
New cards

how does k-nearest-neighbors work?

If we’re at a leaf, fill it with the K closest points, otherwise look at the cloest child bounding box, if list is not full go that way, otheriwse if the list is full, only go to the bounding box if it’s less than or equal to the current distance of the furthest point in the list

16
New cards

How to calculate distance to a bounding box?

knowt flashcard image
17
New cards

What does the $ represent in EKD trees?

Terminating character, sits right above a value which is a leaf

18
New cards

Which nodes can only have one child in an EKD tree?

Root and parents of leaves

19
New cards

How to convert set of strings into a trie

Group by first letter, in each group take the longest prefix, cut off those prefixes, make them branches, and recurse

20
New cards

Are tries unique?

Yes