Data Structures Review

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

1/20

flashcard set

Earn XP

Description and Tags

Flashcards for reviewing key concepts in data structures, including time complexity and properties of linked lists, trees, and arrays.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

The worst-case running time to search in a singularly linked list with n items.

O(n)

2
New cards

Deleting the first node in a circular linked list with n items.

O(1) time

3
New cards

Deleting the first node in a singularly linked list with n items takes O(n) time

false

4
New cards

Insertion into a balanced BST with n items.

O(log n) time

5
New cards

The worst-case running time to search for a value in a 2D n x n array.

O(n²) time

6
New cards

Stacks can be used to reverse a list of objects

True

7
New cards

Maximum height of a 2-3 tree with n items.

log₂n

8
New cards

Union find can be used to determine if two items are connected

True

9
New cards

A singly linked list that only stores the reference to the front node can be transformed into a circular linked list in…

O(n) time because there needs to be a pointer sent to the end of the LL that can point to the head

10
New cards

A singly linked list that only stores the reference to the front node of the list can be reversed in…

O(n)

11
New cards

Binary Search can run on a Doubly Linked List in…

O(n) time since theres no random access, you have to traverse linearly through the LL to get to the middle point

12
New cards

The worst case time complexity to delete an arbitrary item on a Doubly Linked list is…

O(n)

13
New cards

If all elements are connected to each other

Given a parent[] array where parent[i] represents i's immediate parent, we can use union-find to determine…

14
New cards

Concatenating two doubly linked lists can be done in…

O(1)

15
New cards

Search time in an unsorted array

O(n)

16
New cards

Search time in an unsorted linked list

O(n)

17
New cards

Search time in a sorted array

O(log n)

18
New cards

Search time in a sorted linked list

O(n)

19
New cards

Search time in a regular BST

O(n)

20
New cards

Search time in a 2-3 Tree

O(log n)

21
New cards

Search time in a red-black BST

O(log n)