The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged datastructure
Webpage for Data Structures
0
votes
0
answers
1
Cormen Edition 3 Exercise 10.2 Question 8 (Page No. 241)
Explain how to implement doubly linked lists using only one pointer value $x.np$ per item instead of the usual two (next and prev). Assume that all pointer values can be interpreted as $k$bit integers, and define $x.np$ ... $INSERT$, and $DELETE$ operations on such a list. Also, show how to reverse such a list in $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

30
views
cormen
datastructure
linkedlists
descriptive
difficult
0
votes
0
answers
2
Cormen Edition 3 Exercise 10.2 Question 7 (Page No. 241)
Give a $\Theta(n)$ time nonrecursive procedure that reverses a singly linked list of $n$ elements. The procedure should use no more than constant storage beyond that needed for the list itself.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

5
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
3
Cormen Edition 3 Exercise 10.2 Question 6 (Page No. 241)
The dynamicset operation $UNION$ takes two disjoint sets $S_1$ and $S_2$ as input, and it returns a set $S=S_1 \cup S_2$ consisting of all the elements of $S_1$ and $S_2$.The sets $S_1$ and $S_2$ are usually destroyed by the operation. Show how to support $UNION$ in $O(1)$ time using a suitable list data structure.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

1
view
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
4
Cormen Edition 3 Exercise 10.2 Question 5 (Page No. 240)
Implement the dictionary operations $INSERT$, $DELETE$, and $SEARCH$ using singly linked, circular lists. What are the running times of your procedures?
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

4
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
5
Cormen Edition 3 Exercise 10.2 Question 4 (Page No. 240)
LISTSEARCH’(L, k) 1 x = L.nil.next 2 while x != L.nil and x.key != k 3 x = x.next 4 return x As written, each loop iteration in the LISTSEARCH’ procedure requires two tests: one for $x\neq L.nil$ and one for $x.key\neq k$. Show how to eliminate the test for $x\neq L.nil$ in each iteration.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

1
view
cormen
datastructure
linkedlists
descriptive
0
votes
1
answer
6
Cormen Edition 3 Exercise 10.2 Question 3 (Page No. 240)
Implement a queue by a singly linked list $L$. The operations of $ENQUEUE$ and $DEQUEUE$ should still take $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

2
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
7
Cormen Edition 3 Exercise 10.2 Question 2 (Page No. 240)
Implement a stack using a singly linked list $L$. The operations $PUSH$ and $POP$ should still take $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

3
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
8
Cormen Edition 3 Exercise 10.2 Question 1 (Page No. 240)
Can you implement the dynamicset operation $INSERT$ on a singly linked list in $O(1)$ time? How about $DELETE$?
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

1
view
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
9
Cormen Edition 3 Exercise 10.1 Question 7 (Page No. 236)
Show how to implement a stack using two queues. Analyze the running time of the stack operations.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

22
views
cormen
datastructure
stack
descriptive
0
votes
0
answers
10
Cormen Edition 3 Exercise 10.1 Question 6 (Page No. 236)
Show how to implement a queue using two stacks. Analyze the running time of the queue operations.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

2
views
cormen
datastructure
queues
descriptive
0
votes
0
answers
11
Cormen Edition 3 Exercise 10.1 Question 5 (Page No. 236)
Whereas a stack allows insertion and deletion of elements at only one end, and a queue allows insertion at one end and deletion at the other end, a deque (double ended queue) allows insertion and deletion at both ends. Write ... time procedures to insert elements into and delete elements from both ends of a deque implemented by an array.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

6
views
cormen
algorithms
datastructure
queues
descriptive
0
votes
0
answers
12
Cormen Edition 3 Exercise 10.1 Question 4 (Page No. 235)
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

4
views
cormen
datastructure
queues
descriptive
0
votes
0
answers
13
Cormen Edition 3 Exercise 10.1 Question 3 (Page No. 235)
ENQUEUE(Q, x) 1 Q[Q.tail] = x 2 if Q.tail == Q.length 3 Q.tail = 1 4 else Q.tail = Q.tail + 1 DEQUEUE(Q) 1 x = Q[Q.head] 2 if Q.head == Q.length 3 Q.head = 1 4 else Q.head = Q.head + 1 5 return x illustrate the ... (Q,4),ENQUEUE(Q,1),ENQUEUE(Q,3),DEQUEUE(Q),ENQUEUE(Q,8),DEQUEUE(Q) on an initially empty queue $Q$ stored in array $Q[1...6]$.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

8
views
cormen
datastructure
queues
descriptive
0
votes
0
answers
14
Cormen Edition 3 Exercise 10.1 Question 2 (Page No. 235)
Explain how to implement two stacks in one array $A[1...n]$ in such a way that neither stack overflows unless the total number of elements in both stacks together is $n$.The $PUSH$ and $POP$ operations should run in $O(1)$ time.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

5
views
cormen
datastructure
stack
descriptive
0
votes
1
answer
15
Cormen Edition 3 Exercise 10.1 Question 1 (Page No. 235)
STACKEMPTY(S) 1 if S.top == 0 2 return TRUE 3 else return FALSE PUSH(S , x) 1 S.top = S.top + 1 2 S[S.top] = x POP(S) 1 if STACKEMPTY(S) 2 error underflow 3 else S.top = S.top  1 4 return S[S.top + 1] illustrate the result of ... $S$ stored in array $S[1...6]$
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
40.9k
points)

6
views
cormen
datastructure
stack
descriptive
0
votes
1
answer
16
GEEKS FOR GEEKS GATE 2017 MOCK
If Kruskal’s algorithm is used for finding a minimum spanning tree of a weighted graph G with n vertices and m edges and edge weights are already given in a sorted list, then, What will be the time complexity to compute the minimum cost spanning tree given that union and find operations take amortized O(1) ? A O(m logn) B O(n) C O(m) D O(n logm)
asked
Jun 9
in
Algorithms
by
Hirak
Active
(
3.3k
points)

62
views
kruskalsalgorithm
graphalgorithms
greedyalgorithm
datastructure
+1
vote
0
answers
17
Allen Career Institute:Circular Queue
$1)$How circular queue can be implemented? $2)$ For which data structure circular queue cannot be implemented? $(A)$Array $(B)$ Singly Linked List $(C)$ Doubly Linked List $(D)$ Stack
asked
May 24
in
DS
by
srestha
Veteran
(
112k
points)

138
views
datastructure
circularqueue
0
votes
0
answers
18
Made Easy Test Series: Stack Address
A stack based CPU executes the instruction. Memory location $500$ contain $0X 88$ and memory location $700$ contain $0X37$. The stack pointer is at $0X003F$ The instruction are as follows: $I_{1}:PUSH$ $500$ $I_{2}:PUSH$. $700$ ... execution of instruction. $C)$ Memory location $600$ contain $0XBF$ after execution of instruction. $D)$ Both $a)$ and $c)$
asked
May 22
in
DS
by
srestha
Veteran
(
112k
points)

30
views
madeeasytestseries
datastructure
stack
+2
votes
1
answer
19
Vani Qs Bank Algorithms
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i. Ans should be O(log n) right by doing binary search ??
asked
May 21
in
Algorithms
by
Hirak
Active
(
3.3k
points)

117
views
algorithms
datastructure
arrays
searching
0
votes
2
answers
20
Made Easy Test Series:Data StructureStack
There is given a infix expression: ${\color{Red} {1}}$ $A+B\times C/\left ( \left ( D+E \right )+F\times G \right )$ While converting infix expression to postfix expression number of symbols in the stack at indicated ... $5$, but is it correct? Can anyone give some explanation??
asked
May 6
in
DS
by
srestha
Veteran
(
112k
points)

97
views
madeeasytestseries
datastructure
stack
0
votes
2
answers
21
Made Easy Test Series: DSHash Table
Consider a hash table with $N$ slots. It is given that the collision resolution technique used in chaining. Assume simple uniform hashing, what is the probability that the last $k$ slots are unfilled after the first $'r'$ insertions? $A)\left ( 1\frac{N}{k} \right )^{r}$ ... $C)\left ( 1+\frac{N}{k} \right )^{r1}$ $D)\left ( 1\frac{k}{N} \right )^{r1}$
asked
May 5
in
DS
by
srestha
Veteran
(
112k
points)

65
views
datastructure
madeeasytestseries
hashing
0
votes
0
answers
22
Made Easy Test Series:DSArray
Consider the integer array $A\left [ 1.........100,1.......100 \right ]$ in which the elements are stored in $Z$ representation. An example of a $5\times 5$ array in $Z$ representation is shown below: If the base address of $A$ is ... $A$ is stored in Row Major Order, then the address corresponding to $A\left [ 100 \right ]\left [ 55 \right ]$ is ________________
asked
May 4
in
Programming
by
srestha
Veteran
(
112k
points)

66
views
madeeasytestseries
datastructure
0
votes
1
answer
23
Made Easy Test Series:DSBinary Tree
Consider the following function foobar(), which takes binary tree as input. int foobar(struct node *root){ if(!root) return 0; if((!root>left)&&(!root>right)) return 10; else{ int i=foobar(root>left); int j=foobar(root> ... $C)$ Sum of leaves node of binary tree. $D)$ None What return $10$ actually means?
asked
May 4
in
DS
by
srestha
Veteran
(
112k
points)

32
views
madeeasytestseries
datastructure
0
votes
1
answer
24
Made Easy Test Series: Array
Consider a 2D array $A\left [ 40.........95,40........95 \right ]$ in lower triangular matrix representation. Size of each element of array is $1B.$ If the array is implemented in memory in the form of row major order and base address of the array is $1000.$, the address of $A\left [66 \right ]\left [ 50 \right ]$ will be__________ will it be 1361 or 1362?
asked
May 3
in
DS
by
srestha
Veteran
(
112k
points)

29
views
datastructure
madeeasytestseries
0
votes
1
answer
25
Made Easy Test Series: ProgrammingRecursive and Iterative Program
$I=$Iterative Program $R=$ Recursive Program $(A)$ For every program belonging to class $I$, there is an equivalent program to class $R.$ $(B)$ Every program in $R$ uses strictly more stack space compared to equivalent program in $I.$ Among $(A)$ and $(B)$ which one is correct?
asked
May 3
in
Programming
by
srestha
Veteran
(
112k
points)

16
views
madeeasytestseries
datastructure
0
votes
1
answer
26
Made Easy Test Series: DS
A $d$ary heap is a binary heap, but instead of $2$ children, nodes have $d$ children. A $dary$ heap can be represented by $1D$ array as follows. The root is kept in $A[1]$, and it's $d$ children are kept in order in $A[2]$ through $A[d+1]$ ... $A\left [ d^{2}+d+2 \right ]$
asked
May 2
in
DS
by
srestha
Veteran
(
112k
points)

62
views
madeeasytestseries
datastructure
0
votes
1
answer
27
Made Easy Test Series: Data Structure
$A)$ Rotation operation of AVL tree always preserves the inorder numbering. $B)$ If every node of BST has either $0$ or $2$ children , then searching time is $O(log n)$ Which statement is correct? Given $A)$ is correct but $B)$ is not. Plz explain how?
asked
May 2
in
DS
by
srestha
Veteran
(
112k
points)

31
views
datastructure
madeeasytestseries
0
votes
1
answer
28
Made Easy Test Series:Binary Tree
Consider the following function with a binary tree with atleast one node: int path(struct node *x, int len){ if(x==NULL) return B; else return A; } Assume the above function is used to check the given binary tree has any path with specified length from root to ... $B$ is $(len== 1)$ which of these two option correct? Please Explain.
asked
Apr 30
in
DS
by
srestha
Veteran
(
112k
points)

87
views
madeeasytestseries
datastructure
0
votes
1
answer
29
Made Easy Test Series:Data Structure
Assume a Binary Search Tree is not allowed to have duplicates, there is more than one way to delete a node in the tree when the node has two children.If we resolve the situation in favor of choosing element for replacement from ... ? If we resolve the situation in favor of choosing element for replacement from left substructure what this line exactly means?
asked
Apr 30
in
DS
by
srestha
Veteran
(
112k
points)

22
views
datastructure
madeeasytestseries
0
votes
1
answer
30
Self Doubt on Linked List
Can somebody write the code or algorithm, how merge sort works efficiently in linked list? Is Heap sort most inefficient in Linked List Sorting? Elaborate plz
asked
Apr 29
in
DS
by
srestha
Veteran
(
112k
points)

35
views
linkedlists
datastructure
Page:
1
2
3
4
5
6
...
39
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
How to prepare for GATE with a fulltime job??
Interview Experience at IISc
All subject Gate notes from Standard Books!!
My journey from Wipro to an IISc student  GATE 2019
Interview Experience at IITPalakkad
Follow @csegate
Recent questions tagged datastructure
Recent Blog Comments
Hi, the previous email was sent to only those who...
@kriti05 can you please tell me when did you got...
It was said that there will be an address...
sir .I recvd a mail which states "Your...
49,808
questions
54,489
answers
188,271
comments
74,682
users