Intro to Data Structures Flashcards

1
Q

Arrays

A

A basic data structure with homogeneous data types referenced by index, contiguous locations

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

Arrays; Ordering:

A

sequential

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

Array: Big O notation

A

O(1) for accessing
O(n) for searching
O(n) for insertion and deletion
O(log n) for binary searching

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

Linked-List: Single-Linked List

A

each node points to the next node. Tail points to null

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

Linked-List: Double-Linked List

A

Each node points to the next and previous node. Head points to null and next, Tail points to previous and null.

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

Linked-List: Circle-Linked List

A

The tail points to the head, closes the loop

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

Linked-List Big O notation

A

O(n) for accessing
O(n) for searching
O(1) for insertion
O(1) for deletion

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

Stack:

A

Containers of “objects” that are inserted and removed according to LIFO

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

Stack Operations

A

Pull= inserting object to the top of the stack

Pop= remove from the stack and return the top object to the stack

empty()= returns true if empty

peek()= returns element on top of stack without removing it

search()= searches for elements in the stack

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

Stack Big O notation

A

O(n) for accessing
O(n) for search
O(1) for insertion
O(1) for deletion

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

Queues

A

Cousins of Stacks

Containers of “objects” that are inserted and deleted according to FIFO

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

Queues: Operations

A
poll()
remove()
peek()
element()
offer()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Queues: Big O notation

A

O(n) for accessing
O(n) for searching
O(1) for insertion
O(1) for deletion

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

Tree

A

A non-linear data structure where the objects are organised in terms of hierarchical relationships

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