Data Structures Flashcards

1
Q

Array Index

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Array Search

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Hash Table Search

A

O(1) avg, O(n) worst

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hash Table Insertion/Deletion

A

O(1) avg, O(n) worst

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Arrays are optimal for?

A

Indexing. Slow to search, insert, and delete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Linked lists, stacks, and queues are optimal for?

A

Insertion and deletion. Slow at indexing and searching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Linked list, Stack, Queue Insertion/Deletion

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Linked List, Stack, Queue Index/Search

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

HashMaps are optimal for?

A

Searching, insertion, and deletion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Hash Collision

A

When a hash function returns the same output for two different inputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Binary Search Tree

A

Access, search, insertion, and deletion are all log n (light green)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Heap

A

A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Generally, Heaps can be of two types:

Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.

Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly