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