Beginner DS Flashcards

1
Q

Data Structure

A

A particular way of organizing data in a computer so that it can be used effectively.

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

Access, Insertion, Deletion, Search

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

Big O

A

Mathematical notation represents the worst case run time or space requirements as input size increases

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

Constant time

A

Regardless of the input size the runtimes stays the same

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

Linear time

A

As the input size grows the runtime grows linearly

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

Quadratic time

A

As the input size grows the runtime grows quadratically

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

Logarithmic Time

A

As the input size grows the runtime grows logarithmically

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

Array

Think?

A

Think eggs – A linear data structure of fixed size that is used to store the same type of elements at a contiguous location. The location is called indexes, which represents the location of the object in memory.

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

Linked list

Think?

A

Think a chain with links – Consists of nodes where each node contains a data field and a reference(pointers; they are what chain the nodes together that is what constitutes the linked part of a linked list. The pointers are the address or location in memory of the connected nodes)to the next node in the list.

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

Stack

Think?

A

Think Pringles – Containers distinguished by last in first out (LIFO) retrieval order. Pop - take it out from the top; push - put it back at the top

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

Queue Think?

A

Think Food Truck serving customers – Waiting for something FIFO (First in first out). On queue meaning you add it to the back

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

Graph

A

Each node is called vertex and each vertex is connected to other vertices through edges

Strength

Weakness

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

Trees

A

A collection of vertices and edges, However, there can only be one edge between two vertices.

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

Arrays Strength and Weaknesses

A

Strengths:
Access happens in constant time(search, insertion, deletion)
Weakness:
A fixed size cannot change size unless you have a dynamic array or an arrayList
Searching for an element is really slow and happens in linear time

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

Linked List S&W

A

Strength
Insertion and deletion in constant time
Dynamic Size

Weakness
Search in linear time
Additional memory for pointer

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

Stack S&W

A

Strength
Its LIFO retrieval order
Insertion in constant time
Deletion in constant time

Weakness
Search in linear time

17
Q

Queue S&W

A

Strength
Its FIFO retrieval order
Insertion in constant time (enqueue)
Deletion in constant time(deQueue)

Weakness
Search in linear time