What is Data Structures? It is the organization of data. Flashcards

1
Q

What is a data structure?

A

A data structure is a way of organizing and storing data to enable efficient access and modification.

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

True or False: Data structures only refer to physical storage methods.

A

False

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

Fill in the blank: The primary purpose of data structures is to manage _____ effectively.

A

data

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

What are the two main types of data structures?

A

Primitive and non-primitive data structures.

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

Which of the following is a non-primitive data structure? (a) Integer (b) Array (c) Character

A

b) Array

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

True or False: Arrays are a type of linear data structure.

A

True

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

What is a linked list?

A

A linked list is a collection of nodes where each node contains data and a reference to the next node in the sequence.

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

Which data structure uses a Last In First Out (LIFO) method?

A

Stack

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

What is a queue in data structures?

A

A queue is a collection of elements that follows the First In First Out (FIFO) principle.

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

Fill in the blank: A _____ is a data structure that allows for the efficient retrieval of data based on a key.

A

Hash table

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

What is the primary benefit of using a tree data structure?

A

It allows hierarchical data representation and efficient searching, insertion, and deletion.

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

True or False: A binary tree can have more than two children per node.

A

False

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

What is a graph data structure?

A

A graph is a collection of nodes connected by edges, used to represent relationships between entities.

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

Which traversal method visits all nodes of a tree in order of their values?

A

In-order traversal

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

What is the difference between a stack and a queue?

A

A stack follows LIFO order, while a queue follows FIFO order.

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

True or False: Data structures do not affect the performance of algorithms.

17
Q

What is the purpose of a priority queue?

A

A priority queue is used to manage a set of elements with priorities, allowing for efficient retrieval of the highest priority element.

18
Q

Fill in the blank: A _____ is a specialized tree used to maintain order and allow efficient searching.

A

Binary search tree

19
Q

What is a dynamic array?

A

A dynamic array is an array that can change in size during runtime, allowing for flexible data storage.

20
Q

Which data structure is best for implementing recursive algorithms?

21
Q

True or False: Each node in a binary tree can have up to three children.

22
Q

What is the time complexity of searching in a balanced binary search tree?

23
Q

Which data structure is suitable for representing relationships in social networks?

24
Q

Fill in the blank: A _____ is a data structure that can grow and shrink in size dynamically.

A

Linked list

25
Q

What is the main advantage of using hash tables?

A

They provide average-case constant time complexity for search, insertion, and deletion operations.