What is Data Structures? It is the organization of data. Flashcards
What is a data structure?
A data structure is a way of organizing and storing data to enable efficient access and modification.
True or False: Data structures only refer to physical storage methods.
False
Fill in the blank: The primary purpose of data structures is to manage _____ effectively.
data
What are the two main types of data structures?
Primitive and non-primitive data structures.
Which of the following is a non-primitive data structure? (a) Integer (b) Array (c) Character
b) Array
True or False: Arrays are a type of linear data structure.
True
What is a linked list?
A linked list is a collection of nodes where each node contains data and a reference to the next node in the sequence.
Which data structure uses a Last In First Out (LIFO) method?
Stack
What is a queue in data structures?
A queue is a collection of elements that follows the First In First Out (FIFO) principle.
Fill in the blank: A _____ is a data structure that allows for the efficient retrieval of data based on a key.
Hash table
What is the primary benefit of using a tree data structure?
It allows hierarchical data representation and efficient searching, insertion, and deletion.
True or False: A binary tree can have more than two children per node.
False
What is a graph data structure?
A graph is a collection of nodes connected by edges, used to represent relationships between entities.
Which traversal method visits all nodes of a tree in order of their values?
In-order traversal
What is the difference between a stack and a queue?
A stack follows LIFO order, while a queue follows FIFO order.
True or False: Data structures do not affect the performance of algorithms.
False
What is the purpose of a priority queue?
A priority queue is used to manage a set of elements with priorities, allowing for efficient retrieval of the highest priority element.
Fill in the blank: A _____ is a specialized tree used to maintain order and allow efficient searching.
Binary search tree
What is a dynamic array?
A dynamic array is an array that can change in size during runtime, allowing for flexible data storage.
Which data structure is best for implementing recursive algorithms?
Stack
True or False: Each node in a binary tree can have up to three children.
False
What is the time complexity of searching in a balanced binary search tree?
O(log n)
Which data structure is suitable for representing relationships in social networks?
Graph
Fill in the blank: A _____ is a data structure that can grow and shrink in size dynamically.
Linked list
What is the main advantage of using hash tables?
They provide average-case constant time complexity for search, insertion, and deletion operations.