Data structures
  • 1. Data structures are a key component of computer science that enable efficient organization, storage, and retrieval of data. They provide a way to represent and manipulate data in a structured and logical manner, allowing for faster and more effective algorithms and programs. Common data structures include arrays, linked lists, stacks, queues, trees, and graphs, each with its own unique properties and uses. Understanding data structures is essential for software developers to solve complex problems, optimize performance, and design scalable systems. By choosing the right data structure for a given task, developers can improve efficiency, reduce time complexity, and enhance overall software quality.

    What is a linked list?
A) A data structure that can only store one type of data
B) A data structure that allows elements to be accessed randomly
C) A data structure where each element points to the next element in the sequence
D) A group of data items of the same type
  • 2. Which data structure uses the Last In, First Out (LIFO) principle?
A) Stack
B) Queue
C) Array
D) Linked list
  • 3. What is a binary tree?
A) A data structure that can only store binary data
B) A hierarchical data structure in which each node has at most two children
C) A tree data structure where each node can have unlimited children
D) A data structure where elements are stored in a sorted sequence
  • 4. Which data structure uses the First In, First Out (FIFO) principle?
A) Stack
B) Binary tree
C) Linked list
D) Queue
  • 5. What is an array?
A) A data structure that only allows elements to be added at the beginning
B) A data structure that cannot be resized once created
C) A sequential collection of elements, each identified by an index or key
D) A structure that can only hold numeric values
  • 6. Which data structure organizes data in a hierarchy of nodes?
A) Linked list
B) Queue
C) Tree
D) Array
  • 7. What is a hash table?
A) A table that contains only hash values
B) A data structure that stores data in a random order
C) A structure used for hashing passwords
D) A data structure that maps keys to values for efficient lookup
  • 8. Which data structure uses pointers to connect elements in a linear sequence?
A) Tree
B) Array
C) HashTable
D) Linked list
  • 9. What is a graph data structure used for?
A) Sorting elements in ascending order
B) Performing mathematical calculations
C) Storing data in a sequential manner
D) Representing networks and connections between elements
  • 10. What does the term 'abstract data type' (ADT) refer to?
A) A type of encryption used for securing data
B) A type of code abstraction used in software development
C) A mathematical model for data types, where data is defined as a set of values and operations
D) A programming language that is not specifically tied to any hardware
  • 11. What type of data structure is a graph?
A) Linear
B) Hierarchical
C) Non-linear
D) Sequential
  • 12. In a heap data structure, what property is satisfied at every node?
A) Search Property
B) Balance Property
C) Heap Property
D) Tree Property
  • 13. What is the time complexity for searching in a binary search tree?
A) O(log n)
B) O(n log n)
C) O(n)
D) O(1)
  • 14. Which data structure is commonly used for efficiently searching for words in a dictionary?
A) Stack
B) Heap
C) Trie
D) Queue
  • 15. In a linked list, what is the name of the node that has no link to the next node?
A) Head
B) Tail
C) Root
D) Middle
  • 16. In a queue, which operation adds an element to the rear end?
A) Push
B) Pop
C) Enqueue
D) Dequeue
  • 17. What is a self-balancing binary search tree?
A) A search tree that only allows for binary data
B) A tree that balances itself by randomly rearranging nodes
C) A tree that has a fixed height and cannot be adjusted
D) A binary search tree that automatically maintains balanced height during insertions and deletions
  • 18. What is the disadvantage of using an array to store data?
A) Efficient for iterative operations
B) Fast access time
C) Fixed size
D) Easy insertion and deletion
  • 19. Which data structure is used by the heap data structure?
A) Queue
B) Binary tree
C) Stack
D) Hash table
  • 20. In a priority queue, which element is removed first?
A) Highest priority
B) Last inserted element
C) Random element
D) Lowest priority
  • 21. What is a B-tree data structure used for?
A) Efficiently storing and accessing large amounts of data on disk
B) Processing elements based on priority levels
C) Storing and sorting numeric values sequentially
D) Representing hierarchical networks of elements
  • 22. What does a Trie data structure often store?
A) Matrices
B) Strings
C) Integers
D) Floating point numbers
  • 23. Which data structure is used for implementing a priority queue?
A) Array
B) Heap
C) Linked List
D) Queue
  • 24. Which data structure is suitable for modeling real-world networks?
A) Queue
B) Graph
C) Binary search tree
D) Stack
  • 25. Which data structure allows you to access a list of elements using an index or key?
A) Array
B) Linked list
C) Queue
D) Stack
Created with That Quiz — the site for test creation and grading in math and other subjects.