Lecture 5: Data Structure Flashcards

1
Q

What is the unique thing about the data structure: Linked List?

A

The most powerful thing about a linked list is that it can sort a list of values in different parts of memory. contrary arrays which sort data back-to-back in memory

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

What will happend when we insert a new value in a linked list?

A

It will allocate memory for both:

  • the value we want to store
  • the address of the next future value. in other words, these addresses are actually pointers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is β€˜node’?

A

It is the basic unit of a data structure. which has both:

  • value
  • pointer to another node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the unique thing about the data structure: Tree?

A

Using this data structure, each node can only point to 2 children which we call them left child and right child

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

What is the unique thing about the data structure: Hash table?

A

it can associate keys with values.

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

What is the unique thing about the data structure: Trie?

A

it is actually a tree with arrays as nodes so each array points to another array whenever it found the desired value

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

What is the order of the data structure: Queue?

A

First In First Out (FIFO) it is like a line of people waiting πŸ‘«
To add a value we enqueue it, and to remove a value we dequeue it. We could use a growing array or a linked list.

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

What is the order of the data structure: Stack?

A

Last In First Out (LIFO) it is like stacked plates over one another in the canteen. The last plate which is at the top is the first one to be removed

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

The graph is a different data structure that basically

A

connects a mutable set of nodes (also called vertices) together using edges (also called links or lines)

The Graph is composed of a set of vertices( V ) and a set of edges (E)

G(E, V)

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