Data structure

What is the time complexity of inserting an element at the end of an array in the worst case?
O(n)
O(1)
O(log n)
O(n^2)
Which of the following data structures uses LIFO (Last-In-First-Out) principle?
Queue
Stack
Linked List
Heap
What is the worst-case time complexity of searching for an element in a binary search tree?
O(n)
O(n^2)
O(1)
O(log n)
Which data structure is used to implement depth-first search (DFS) algorithm?
Stack
Queue
Heap
Linked List
What is the purpose of a hash table in data structures?
To provide efficient key-value pair lookups
To sort elements in ascending order
To store data in a sequential manner
To perform mathematical calculations
Which sorting algorithm has a worst-case time complexity of O(n^2)?
Bubble Sort
Merge Sort
Quick Sort
Insertion Sort
What is the purpose of a linked list in data structures?
To store and manipulate collections of elements
To perform mathematical calculations
To provide efficient key-value pair lookups
To sort elements in ascending order
What is the time complexity of inserting an element at the beginning of an array in the worst case?
O(n)
O(1)
O(log n)
O(n^2)
Which data structure is used to implement breadth-first search (BFS) algorithm?
Queue
Stack
Heap
Linked List
What is the purpose of a binary heap in data structures?
To efficiently extract the minimum or maximum element
To sort elements in ascending order
To store data in a sequential manner
To perform mathematical calculations
{"name":"Data structure", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the time complexity of inserting an element at the end of an array in the worst case?, Which of the following data structures uses LIFO (Last-In-First-Out) principle?, What is the worst-case time complexity of searching for an element in a binary search tree?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Make your own Survey
- it's free to start.