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