1
GATE CSE 2022
+1
-0.33

Consider the problem of reversing a singly linked list. To take an example, given the linked list below:

the reversed linked list should look like

Which one of the following statements is TRUE about the time complexity of algorithms that solve the above problem in O(1) space?

A
The best algorithm for the problem takes $$\theta$$(n) time in the worst case.
B
The best algorithm for the problem takes $$\theta$$(n log n) time in the worst case.
C
The best algorithm for the problem takes $$\theta$$(n2) time in the worst case.
D
It is not possible to reverse a singly linked list in O(1) space.
2
GATE CSE 2022
+1
-0.33

Suppose we are given n keys, m has table slots, and two simple uniform hash functions h1 and h2. Further suppose our hashing scheme uses h1 for the odd keys and h2 for the even keys. What is the expected number of keys in a slot?

A
$${m \over n}$$
B
$${n \over m}$$
C
$${2n \over m}$$
D
$${n \over 2m}$$
3
GATE CSE 2022
Numerical
+1
-0.33

Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with 0, the 3rd largest element of the tree is stored at index ___________.

4
GATE CSE 2022
Numerical
+1
-0.33

Consider the queues Q1 containing four elements and Q2 containing none (shown as the Initial State in the figure). The only operations allowed on these two queues are Enqueue (Q, element) and Dequeue (Q). The minimum number of Enqueue operations on Q1 required to place the elements of Q1 in Q2 in reverse order (shown as the Final State in the figure) without using any additional storage is ______________.

GATE CSE Papers
2023
2022
2020
2019
2018
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997
1996
1995
1994
1993
1992
1991
1990
1989
1988
1987
EXAM MAP
Medical
NEET