Data Structures Flashcards

1
Q

What is a data structure?

A

It is a group of data elements that provide an efficient way to store and organize data in the computer.

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

What are some applications of data structures?

A

programs, graphics, and operating systems.

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

Why is it necessary to use data structures?

A

As the data and complexity of applications increase the following issues can occur, which can be fixed with the help of data structures.

Acronym: My Dear Paulie

Multiple requests: If thousands of users are requesting data from a web server at the same time, then there is a high probability that the webserver fails

DataSearch: If large amounts of data are stored, searching through it will mean traversing every piece of data.

Processor speed: high processor speeds are required to handle large amounts of data, as this data increases, if it is not stored efficiently, the processor may fail.

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

What are the advantages of data structures?

A

Acronym: EAR

Efficiency: The efficiency of a program depends on the data structures it uses. E.g searching through an array vs a binary search tree

Abstraction: Data structures are identified by their abstract data types, which provide a level of abstraction.

Re-usability: Once implemented data structures can be used multiple times, or packed into libraries to be used by other users or clients

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

how are data structures classified? (draw diagram)

A

Primitive:
-> int, char, bool
non-primitive:
linear:
static:
-> arrays
dynamic:
-> Queues, Stacks, Linked list
non-linear:
->trees and graphs

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

what is a linear data structure?

A

This is a data structure whose data is organized in a linear or non-hierarchical manner.

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

State and explain the types of linear data structures.

A

Static:

Array: It is a collection of similar elements of the same datatype that share the same variable name but differ in indexes

Dynamic:

LinkedList: It is a collection of nodes stored in non-contiguous memory, each node containing a pointer to its adjacent node

Stacks: It is a list of data elements where insertion and deletion can only be done at one end of the list called the top.

Queues: It is a list of data elements where insertion can only be done on one end(rear) and deletion can only be done at the other one(front)

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

What is a non-linear data structure?

A

It is a data structure whose elements are arranged in a non-linear manner, where elements are linked to each other in a hierarchical manner.

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

State and explain the types of non-linear data structures.

A

Trees: It is a collection of nodes arranged in a hierarchical manner where the topmost node is called the root node, and the bottom-most nodes are called the leave nodes. Every node can have multiple child nodes except a leave node and Every node can have 1 parent node except the root node.

Graphs: It is a pictorial representation of a set of elements, represented by vertices. It differs from a tree in that it can contain cycles.

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

What are the possible operations that can be performed on data structures?

A

Acronym: MIDSST

Merging: It is when lists of varying sizes are combined to form a new list.

Insertion: It means adding a data element to a data structure.

Deletion: It means removing a data element from a data structure.

Searching: It means finding the location/index of a particular element in a data structure

Sorting: It means arranging the elements in a data structure in a particular order.

Traversing: It means visiting every element in a data structure to perform an operation

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