Data structures - stacks, queues, linked list

What is the time complexity of inserting an element at the top of a stack?
O(1)
O(n)
O(log n)
O(n^2)
Which of the following data structures follows the Last-In-First-Out (LIFO) principle?
Stack
Queue
Linked List
Binary Tree
What is the main advantage of using a linked list over an array?
Which data structure allows elements to be added or removed from both ends?
Deque
Stack
Queue
Linked List
What is the time complexity of searching for an element in a sorted array using binary search?
O(1)
O(log n)
O(n)
O(n^2)
Which data structure follows the First-In-First-Out (FIFO) principle?
Queue
Stack
Linked List
Binary Tree
What is the main disadvantage of using an array to implement a stack?
Which data structure is best suited for implementing a breadth-first search algorithm?
Queue
Stack
Linked List
Binary Tree
What is the time complexity of inserting an element at the rear of a queue?
O(1)
O(n)
O(log n)
O(n^2)
Which data structure allows elements to be accessed from both ends but does not support random access?
Deque
Stack
Queue
Linked List
{"name":"Data structures - stacks, queues, linked list", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the time complexity of inserting an element at the top of a stack?, Which of the following data structures follows the Last-In-First-Out (LIFO) principle?, What is the main advantage of using a linked list over an array?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker