Question bank

Filter questions by subject, topic and difficulty. Open any question to answer it and see the explanation.

Clear
255 questions found · practise this subject as a set Show 20 · 50 per page
#QuestionSubject and topicDifficulty
121 Which of the following best describes a deque? Computer Science/Informatics Practices
Deque
Easy
122 In a list-based deque d, which statement inserts x at the front? Computer Science/Informatics Practices
Deque
Easy
123 Starting with an empty list d, the operations d.append(5), d.insert(0, 3), d.append(8), d.pop(0) are performe… Computer Science/Informatics Practices
Deque
Medium
124 A deque is used only with insertRear and deletionRear operations. It then behaves like a Computer Science/Informatics Practices
Deque
Medium
125 Why is a deque convenient for checking whether a word is a palindrome? Computer Science/Informatics Practices
Deque
Hard
126 Which condition must a list satisfy before binary search can be applied to it? Computer Science/Informatics Practices
Linear and binary search
Easy
127 What is the worst-case number of comparisons for linear search in a list of n elements? Computer Science/Informatics Practices
Linear and binary search
Easy
128 Binary search is used to find 14 in [3, 9, 14, 21, 30, 38, 45, 52, 60]. How many comparisons with list elemen… Computer Science/Informatics Practices
Linear and binary search
Medium
129 In linear search, when does the best case occur? Computer Science/Informatics Practices
Linear and binary search
Medium
130 What is the maximum number of comparisons binary search needs to search a sorted list of 1,000 elements? Computer Science/Informatics Practices
Linear and binary search
Hard
131 Using the hash function h(k) = k % 10, at which index is the key 57 stored? Computer Science/Informatics Practices
Hashing
Easy
132 What is a collision in hashing? Computer Science/Informatics Practices
Hashing
Easy
133 With h(k) = k % 10 and linear probing, the keys 23, 43 and 13 are inserted in that order into an empty table.… Computer Science/Informatics Practices
Hashing
Medium
134 Why can searching by hashing be faster than binary search? Computer Science/Informatics Practices
Hashing
Medium
135 A hash table of size 7 uses h(k) = k % 7 with linear probing. Slots 6 and 0 are already full. The key 20 is i… Computer Science/Informatics Practices
Hashing
Hard
136 In which sorting method are adjacent elements compared and swapped if they are in the wrong order? Computer Science/Informatics Practices
Sorting algorithms
Easy
137 After the first pass of bubble sort in ascending order, which element is guaranteed to be in its final positi… Computer Science/Informatics Practices
Sorting algorithms
Easy
138 What is the list [7, 3, 9, 1, 5] after the first pass of bubble sort in ascending order? Computer Science/Informatics Practices
Sorting algorithms
Medium
139 What is the list [29, 10, 14, 37, 13] after two passes of selection sort in ascending order? Computer Science/Informatics Practices
Sorting algorithms
Medium
140 For an already sorted list of 8 elements, how many comparisons does insertion sort make? Computer Science/Informatics Practices
Sorting algorithms
Hard