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