Any2Quiz
Quizzes / CBSE / Class 12 / Computer Science / Programming

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, free

Sample questions

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Take the full quiz

More questions in this quiz

Answers and explanations are in the full quiz.

  1. Which data structure uses LIFO (Last-In, First-Out) principle?
  2. Explain the difference between an array and a linked list.
  3. Describe the difference between a binary tree and a binary search tree.
  4. What is a hash table and how does it work?
  5. Implement a function to check if a given binary tree is a balanced binary tree.
  6. What is the difference between a FIFO and LIFO queue?
  7. Explain how to implement a queue using two stacks.

More quizzes

Browse all Programming quizzes

More to play

Daily ChallengeA new quiz every day. Keep your streak.HangmanGuess the word, letter by letter.Story QuestLearn through short interactive stories.All quizzesCBSE, ICSE, competitive exams and more.