Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged python-&-dsa
2
2 votes
3
3 answers
211
211 views
GO Classes DPP | GATE DA | Python & DSA | List Shuffle
A function $\texttt{shuffle(s)}$ takes a sequence $\texttt{s}$ with an even number of elements. It returns a new list by interleaving the first half of $\texttt{s}$ with ...
GO Classes
211
views
asked
Jul 2
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-214
python-&-dsa
goclasses-python-&-dsa-practice-questions
array
list
output
+
–
2
2 votes
3
3 answers
167
167 views
GO Classes DPP | GATE DA | Python & DSA | Extend Append
Consider the following Python code:s = [3] s.extend([4, 5]) s.extend([s.append(9), s.append(10)]) print(s)What is the output of the code above?[3, 4, 5, 9, 10][3, 4, 5, N...
GO Classes
167
views
asked
Jul 2
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-214
python-&-dsa
goclasses-python-&-dsa-practice-questions
array
output
+
–
2
2 votes
3
3 answers
187
187 views
GO Classes DPP | GATE DA | Python & DSA | Alias Slice
Consider the following Python code:s = [9, 7, 8] a, b = s, s[:] print(a is s, b == s, b is s) print(a.pop()) print(a + b)What is the output of the code above?True True Tr...
GO Classes
187
views
asked
Jul 2
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-214
python-&-dsa
goclasses-python-&-dsa-practice-questions
output
array
+
–
2
2 votes
3
3 answers
223
223 views
GO Classes DPP | GATE DA | Python & DSA | List Mutation
Consider the following Python code:s = [6, 7, 8] print(s.append(6)) s.insert(0, 9) x = s.pop(1) s.remove(x) print(s)What is the output of the code above?None [9, 7, 8]Non...
GO Classes
223
views
asked
Jul 2
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-214
python-&-dsa
goclasses-python-&-dsa-practice-questions
output
+
–
3
3 votes
2
2 answers
358
358 views
GO Classes DPP | PYTHON & DSA |BST
Suppose we convert a balanced Binary Search Tree (BST) containing $n$ elements into a Sorted Doubly Linked List (DLL) in-place (without using extra memory for new nodes)....
GO Classes
358
views
asked
Feb 27
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-110
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
220
220 views
GO Classes DPP | PYTHON & DSA |HASHING
A hash table of size $M=11$ uses the hash function $h(k)=k \bmod 11$. QUADRATIC PROBING is used for collision resolution with the probing function $h(k, i)=\left(h(k)+i^2...
GO Classes
220
views
asked
Feb 27
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-110
goclasses-python-&-dsa-practice-questions
numerical-answers
+
–
2
2 votes
1
1 answer
200
200 views
GO Classes DPP | PYTHON & DSA |DIJKSTRA’S ALGO
Let $G=(V, E)$ be a directed graph with source vertex $s$. We run DIJKSTRA'S ALGORITHM to find the shortest paths. During the execution, the "Relaxation" step is performe...
GO Classes
200
views
asked
Feb 27
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-110
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
164
164 views
GO Classes DPP | PYTHON & DSA |QUICKSORT
Consider the QUICKSORT algorithm applied to an array of $n$ distinct elements. Let the pivot always be chosen as the MEDIAN of the array. What is the recurrence relation ...
GO Classes
164
views
asked
Feb 27
Programming
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-110
goclasses-python-&-dsa-practice-questions
+
–
2
2 votes
1
1 answer
196
196 views
GO Classes DPP | PYTHON & DSA |DEQUE
A double-ended queue (DEQUE) supports insertion and deletion at both ends $(f$ for front, $r$ for rear$)$. If we want to implement a STACK using this DEQUE, which of the ...
GO Classes
196
views
asked
Feb 27
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-110
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
210
210 views
GO Classes DPP | PYTHON & DSA |BST
When performing an In-order traversal on a Binary Search Tree (BST) containing $n$ distinct elements, what is the specific property of the resulting sequence?The first el...
GO Classes
210
views
asked
Feb 26
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-109
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
2
2 answers
254
254 views
GO Classes DPP | PYTHON & DSA |DAG
Consider a Directed Acyclic Graph (DAG). We want to find the shortest path from a source vertex $S$ to all other vertices. Since the graph is a DAG, which approach provid...
GO Classes
254
views
asked
Feb 26
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-109
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
204
204 views
GO Classes DPP | PYTHON & DSA |HASHING
In a hash table with $10$ slots and collisions resolved by chaining, the following keys are inserted: $5,25,19,15,20,33,12,17,10$. If the hash function is $h(k)=k \% 10$,...
GO Classes
204
views
asked
Feb 26
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-109
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
2
2 answers
266
266 views
GO Classes DPP | PYTHON & DSA |CIRCULAR QUEUE
A circular queue is implemented using an array of size $M$. If 'front' points to the index of the first element and 'rear' points to the index of the last element, what i...
GO Classes
266
views
asked
Feb 26
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-109
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
199
199 views
GO Classes DPP | PYTHON & DSA |RECURRENCE
Suppose we are sorting an array of $n$ elements using Quicksort. In the worst-case scenario, the partitioning process always picks the smallest or largest element as the ...
GO Classes
199
views
asked
Feb 26
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-109
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
219
219 views
GO Classes DPP | PYTHON & DSA |GRAPH TRAVERSAL
Consider a simple, weighted, directed graph $G=(V, E)$ with $n$ vertices and $m$ edges. Let $w(u, v)$ be the weight of the edge from $u$ to $v$. Which of the following st...
GO Classes
219
views
asked
Feb 25
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-108
goclasses-python-&-dsa-practice-questions
multiple-selects
+
–
2
2 votes
1
1 answer
175
175 views
GO Classes DPP | PYTHON & DSA |TREE TRAVERSAL
Consider a Binary Search Tree (BST) where the post-order traversal is $2,4,3,7,9,8,5$. What is the pre-order traversal of this tree?$5,3,2,4,8,7,9$ $2,3,4,5,7,8,9$ $5,8,9...
GO Classes
175
views
asked
Feb 25
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-108
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
169
169 views
GO Classes DPP | PYTHON & DSA |QUICKSORT
What is the worst-case time complexity of the QuickSort algorithm when the pivot is always chosen as the middle element and the input array is already sorted in ascending...
GO Classes
169
views
asked
Feb 25
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-108
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
163
163 views
GO Classes DPP | PYTHON & DSA |GRAPH
Which of the following properties is/are TRUE for a Simple Undirected Graph $G$ with $n$ vertices and $k$ connected components?DIJKSTRA'S ALGORITHM CAN BE USED TO FIND TH...
GO Classes
163
views
asked
Feb 25
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-108
goclasses-python-&-dsa-practice-questions
multiple-selects
+
–
1
1 vote
1
1 answer
190
190 views
GO Classes DPP | PYTHON & DSA |STACK
In Python, consider a list $\verb|L|$ being used to implement a stack. If we perform $n$ $\verb|append()|$ operations starting from an empty list, what is the amortized t...
GO Classes
190
views
asked
Feb 25
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-108
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
174
174 views
GO Classes DPP | PYTHON & DSA |BINARY SEARCH
An array of $n$ elements is sorted. We want to search for an element using Binary Search. If we modified the algorithm to split the array into three equal parts instead o...
GO Classes
174
views
asked
Feb 24
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-107
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
158
158 views
GO Classes DPP | PYTHON & DSA |GRAPH TRAVERSAL
Which of the following statements is TRUE regarding Breadth-First Search (BFS) and Depth-First Search (DFS) on an unweighted, connected graph?BFS finds the shortest path ...
GO Classes
158
views
asked
Feb 24
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-107
goclasses-python-&-dsa-practice-questions
+
–
2
2 votes
1
1 answer
156
156 views
GO Classes DPP | PYTHON & DSA |HASHTABLE
Consider a hash table with $10$ slots using open addressing with linear probing. The hash function is $h(k)=k \text{(mod 10)}$. After inserting the keys $42,52,62$, and $...
GO Classes
156
views
asked
Feb 24
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-107
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
152
152 views
GO Classes DPP | PYTHON & DSA |QUICKSORT
During the execution of Quicksort on an array of $n$ distinct elements, if the pivot is always chosen such that it is the third smallest element in the current sub-array,...
GO Classes
152
views
asked
Feb 24
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-107
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
176
176 views
GO Classes DPP | PYTHON & DSA |CBT
A complete binary tree with $n$ nodes is represented in an array starting from index $1$. For a node located at index $i$, what is the index of its right child, and what ...
GO Classes
176
views
asked
Feb 24
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-107
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
179
179 views
GO Classes DPP | PYTHON & DSA |MERGESORT
Consider the Merge Sort algorithm being applied to an array of $n$ elements. Which of the following statements is/are TRUE regarding its operational characteristics?Merge...
GO Classes
179
views
asked
Feb 21
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-106
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
156
156 views
GO Classes DPP | PYTHON & DSA |PYTHON
What is the output of the following Python code snippet?def modify_list(lst): lst.append([3, 4]) lst = [7, 8] return lst my_list = [1, 2] new_list = modif...
GO Classes
156
views
asked
Feb 21
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-106
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
137
137 views
GO Classes DPP | PYTHON & DSA |DAG
Consider a Directed Acyclic Graph (DAG). If you perform a Depth First Search (DFS) on this graph and record the "finish times" of each vertex (the time at which the recur...
GO Classes
137
views
asked
Feb 21
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-106
goclasses-python-&-dsa-practice-questions
+
–
0
0 votes
1
1 answer
117
117 views
GO Classes DPP | PYTHON & DSA |BINARY SEARCH
Suppose you are searching for the value $X=35$ in a sorted array $A= [10,20,30,40,50,60,70]$ using the Binary Search algorithm. If the algorithm uses the formula mid $=l ...
GO Classes
117
views
asked
Feb 21
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-106
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
167
167 views
GO Classes DPP | PYTHON & DSA |STACK
Consider a scenario where you are given a stack $S$ and an empty queue $Q$. You perform the following sequence of operations:Push elements $10,20,30,40$ into $S$ in that ...
GO Classes
167
views
asked
Feb 21
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-106
goclasses-python-&-dsa-practice-questions
+
–
1
1 vote
1
1 answer
164
164 views
GO Classes DPP | PYTHON & DSA |MERGESORT
Consider the Merge Sort algorithm applied to an array $A$ of $n$ distinct integers. During the Merge step, we maintain two pointers for the sorted subarrays $L$ and $R$. ...
GO Classes
164
views
asked
Feb 20
Programming in Python
goclasses
python-&-dsa
goclasses-da-dpp
goclasses-da-dpp-day-105
goclasses-python-&-dsa-practice-questions
multiple-selects
+
–
Page:
« prev
1
...
4
5
6
7
8
9
10
11
12
13
14
...
16
next »