Data Structures

Evaluate your understanding of fundamental data structures including arrays, linked lists, stacks, and queues.

10 Questions intermediate

Quiz Questions

  1. What is the time complexity of accessing an element in an array by index?
    • O(1)
    • O(n)
    • O(log n)
    • O(n^2)
  2. Which data structure follows LIFO principle?
    • Queue
    • Stack
    • Array
    • Linked List
  3. What is the time complexity of inserting at the beginning of a linked list?
    • O(1)
    • O(n)
    • O(log n)
    • O(n^2)
  4. Which data structure follows FIFO principle?
    • Stack
    • Queue
    • Tree
    • Graph
  5. What is a Binary Search Tree?
    • A tree with exactly two nodes
    • A tree where each node has at most 2 children and left < root < right
    • A tree used only for searching
    • A balanced tree structure
  6. What is the worst-case time complexity of searching in a hash table?
    • O(1)
    • O(log n)
    • O(n)
    • O(n^2)
  7. Which operation is NOT efficiently supported by arrays?
    • Random access
    • Insertion at end
    • Insertion in middle
    • Finding length
  8. What is a doubly linked list?
    • A list with two heads
    • A list where each node points to next and previous nodes
    • A list that stores pairs of data
    • A list with double memory allocation
  9. What is the height of a balanced binary tree with n nodes?
    • O(n)
    • O(log n)
    • O(n^2)
    • O(1)
  10. Which data structure is best for implementing a priority queue?
    • Array
    • Linked List
    • Heap
    • Stack
Take this Quiz