Question bank

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

7,992 questions found Show 20 · 50 per page
#QuestionSubject and topicDifficulty
2601 In a queue implemented with a Python list q using append() for insertion, which statement removes the front e… Computer Science/Informatics Practices
Queue
Easy
2602 Starting with an empty queue, A, B and C are enqueued, one element is dequeued and then D is enqueued. Which … Computer Science/Informatics Practices
Queue
Medium
2603 Which real-life system is best modelled by a queue? Computer Science/Informatics Practices
Queue
Medium
2604 A student implements a queue with a Python list using append() to insert but pop() with no argument to delete… Computer Science/Informatics Practices
Queue
Hard
2605 Which of the following best describes a deque? Computer Science/Informatics Practices
Deque
Easy
2606 In a list-based deque d, which statement inserts x at the front? Computer Science/Informatics Practices
Deque
Easy
2607 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
2608 A deque is used only with insertRear and deletionRear operations. It then behaves like a Computer Science/Informatics Practices
Deque
Medium
2609 Why is a deque convenient for checking whether a word is a palindrome? Computer Science/Informatics Practices
Deque
Hard
2610 Which condition must a list satisfy before binary search can be applied to it? Computer Science/Informatics Practices
Linear and binary search
Easy
2611 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
2612 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
2613 In linear search, when does the best case occur? Computer Science/Informatics Practices
Linear and binary search
Medium
2614 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
2615 Using the hash function h(k) = k % 10, at which index is the key 57 stored? Computer Science/Informatics Practices
Hashing
Easy
2616 What is a collision in hashing? Computer Science/Informatics Practices
Hashing
Easy
2617 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
2618 Why can searching by hashing be faster than binary search? Computer Science/Informatics Practices
Hashing
Medium
2619 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
2620 In which sorting method are adjacent elements compared and swapped if they are in the wrong order? Computer Science/Informatics Practices
Sorting algorithms
Easy