Top and common 25 questions in Algorithm and Data Structures
University of London
1. What is a data structure?
A data structure is a way of organizing and storing data in a computer so that it
can be accessed and modified efficiently.
2. What are the basic data structures?
Basic data structures include arrays, linked lists, stacks, queues, trees, and graphs.
3. Explain the difference between an array and a linked list.
An array stores elements of the same data type in contiguous memory locations,
allowing random access to elements. A linked list, however, stores elements in
nodes where each node contains a data field and a reference (pointer) to the next
node, allowing dynamic memory allocation and efficient insertion/deletion
operations.
4. What is a stack?
A stack is a linear data structure that follows the Last In, First Out (LIFO)
principle. Elements are added and removed from the same end called the top.
5. How can you implement a stack?
A stack can be implemented using arrays or linked lists.
6. What is a queue?
A queue is a linear data structure that follows the First In, First Out (FIFO)
principle. Elements are added at the rear and removed from the front.
7. How can you implement a queue?
A queue can be implemented using arrays or linked lists.
8. Explain the concept of a binary tree.
A binary tree is a hierarchical data structure in which each node has at most two
children, referred to as the left child and the right child.
9. What is a binary search tree (BST)?
A binary search tree is a binary tree in which the left child of each node contains a
value less than the node's value, and the right child contains a value greater than
the node's value.
10. What are the basic operations on a binary search tree?
University of London
1. What is a data structure?
A data structure is a way of organizing and storing data in a computer so that it
can be accessed and modified efficiently.
2. What are the basic data structures?
Basic data structures include arrays, linked lists, stacks, queues, trees, and graphs.
3. Explain the difference between an array and a linked list.
An array stores elements of the same data type in contiguous memory locations,
allowing random access to elements. A linked list, however, stores elements in
nodes where each node contains a data field and a reference (pointer) to the next
node, allowing dynamic memory allocation and efficient insertion/deletion
operations.
4. What is a stack?
A stack is a linear data structure that follows the Last In, First Out (LIFO)
principle. Elements are added and removed from the same end called the top.
5. How can you implement a stack?
A stack can be implemented using arrays or linked lists.
6. What is a queue?
A queue is a linear data structure that follows the First In, First Out (FIFO)
principle. Elements are added at the rear and removed from the front.
7. How can you implement a queue?
A queue can be implemented using arrays or linked lists.
8. Explain the concept of a binary tree.
A binary tree is a hierarchical data structure in which each node has at most two
children, referred to as the left child and the right child.
9. What is a binary search tree (BST)?
A binary search tree is a binary tree in which the left child of each node contains a
value less than the node's value, and the right child contains a value greater than
the node's value.
10. What are the basic operations on a binary search tree?