ArtOfCode.org
Toggle Menu
Home
Online Rust Compiler
Tutorials
Algorithms 101
Html Css Tutorial
Javascript Tutorial
Blog
All Posts
Data Structures for Algorithms
Quiz stacks queues heaps and hash tables.
1. Which data structure provides O(1) average time complexity for access by index?
Array
Singly Linked List
Stack
Queue
2. Select all linear data structures from the options below.
Array
Binary Tree
Stack
Queue
Graph
3. A stack data structure follows the LIFO (Last In First Out) principle.
True
False
4. What data structure consists of vertices (nodes) connected by edges, where each vertex can have multiple neighbors?
5. Which data structure is most efficient for implementing a priority queue?
Array
Linked List
Heap
Hash Table
6. Which operations have O(1) time complexity in a properly implemented dynamic array?
Access by index
Append to the end
Insert at the beginning
Delete from the end
Search for an element
7. In a binary search tree (BST), the left child of a node is always smaller than the node, and the right child is always larger.
True
False
8. What data structure allows adding elements to one end (rear) and removing from the other end (front), following FIFO order?
9. Which data structure has no fixed size and allows dynamic memory allocation with nodes containing data and pointers?
Array
Linked List
Stack
Heap
10. Which of the following data structures can be used to implement a stack?
Array
Singly Linked List
Queue
Binary Tree
Hash Table
Reset
Answered 0 of 0 — 0 correct