Data Structures Quiz - CBSE Class 12 Computer Science
Free practice quiz: Data Structures (CBSE Class 12 Computer Science). 12 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
This CBSE Class 12 Computer Science practice quiz has 12 multiple-choice questions on Data Structures, and 12 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.
Start quiz: 12 questions, freeSample questions
What is a data structure?
Show answer
Answer: A. A way to organize data in a computer
Data structures are fundamental ways to organize and store data in a computer so that it can be used efficiently.
What is the time complexity of searching for an element in a sorted array using binary search?
Show answer
Answer: C. O(log n)
Binary search has a time complexity of O(log n) because it repeatedly divides the search interval in half.
What is a graph?
Show answer
Answer: B. A non-linear data structure consisting of nodes and edges
A graph is a non-linear data structure composed of nodes (vertices) connected by edges.
What are the advantages and disadvantages of using a heap data structure?
Show answer
Answer: B. Advantages: efficient insertion and deletion, efficient finding of min/max; Disadvantages: slow search.
Heaps excel at priority queue operations but are not ideal for searching.
Design a data structure to efficiently manage a system for tracking real-time stock prices of multiple companies, allowing for quick updates and retrievals. Justify your choice.
Show answer
Answer: B. A hash table is suitable for quick retrieval of stock prices.
Hash tables provide O(1) average time complexity for both insertion and retrieval, making them suitable for real-time updates and lookups of stock prices. Company names or stock symbols can act as keys.
More questions in this quiz
Answers and explanations are in the full quiz.
- Which data structure uses LIFO (Last-In, First-Out) principle?
- Explain the difference between an array and a linked list.
- Describe the difference between a binary tree and a binary search tree.
- What is a hash table and how does it work?
- Implement a function to check if a given binary tree is a balanced binary tree.
- What is the difference between a FIFO and LIFO queue?
- Explain how to implement a queue using two stacks.
More quizzes
Browse all Programming quizzes