Name two basic operations performed on data structures.
Insertion and deletion
Give one example of an ADT.
Stack
What is an algorithm?
A finite set of steps used to solve a problem.
What is an array?
An array is a collection of elements stored in contiguous memory locations.
What is a linked list?
A collection of nodes where each node contains data and a link.
What operation is used to locate an element in a data structure?
Searching.
What are the two main components of an ADT?
Data & Operations
What does algorithm complexity measure?
The efficiency of an algorithm.
How are array elements accessed?
Using an index value
What is stack overflow?
Attempting to push an element into a full stack.
What operation arranges data in a specific order?
sorting
Which ADT follows the LIFO principle?
Stack
What is time complexity?
The amount of time an algorithm takes to run as input size increases.
What is the index of the first element in an array?
0
What is the operation used to insert an element in a queue?
Enqueue.
What operation combines two data structures into one? structure.
Merging
Which ADT follows the FIFO principle?
Queue
What is space complexity?
The amount of memory an algorithm uses.
What is the main limitation of arrays?
Fixed size
What is queue overflow?
Inserting an element into a full queue.
Which operation removes an element from a data structure?
Deletion
How is an ADT different from a data structure?
ADT defines what operations are performed, while data structure defines how they are implemented.
What is time–space trade-off?
Using more memory to reduce execution time or vice versa.
Why is insertion in the middle of an array inefficient?
Because elements must be shifted.
List any 2 examples of Data Structure
Arrays,tree,graph,stack,queue