menu
Questions by akash.dinkar12
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Questions by akash.dinkar12
All Activity
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Prev
Blogs
New Blog
Exams
Questions by akash.dinkar12
Filter
User akash.dinkar12
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
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
in
Algorithms
Jun 30, 2019
449
views
cormen
data-structure
linked-lists
descriptive
difficult
0
votes
1
answer
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
in
Algorithms
Jun 30, 2019
306
views
cormen
data-structure
linked-lists
descriptive
1
vote
1
answer
3
Cormen Edition 3 Exercise 10.2 Question 6 (Page No. 241)
The dynamic-set 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
in
Algorithms
Jun 30, 2019
347
views
cormen
data-structure
linked-lists
descriptive
1
vote
1
answer
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
in
Algorithms
Jun 30, 2019
313
views
cormen
data-structure
linked-lists
descriptive
0
votes
0
answers
5
Cormen Edition 3 Exercise 10.2 Question 4 (Page No. 240)
LIST-SEARCH’(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 LIST-SEARCH’ 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
in
Algorithms
Jun 30, 2019
194
views
cormen
data-structure
linked-lists
descriptive
1
vote
2
answers
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
in
Algorithms
Jun 30, 2019
235
views
cormen
data-structure
linked-lists
descriptive
1
vote
1
answer
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
in
Algorithms
Jun 30, 2019
225
views
cormen
data-structure
linked-lists
descriptive
0
votes
1
answer
8
Cormen Edition 3 Exercise 10.2 Question 1 (Page No. 240)
Can you implement the dynamic-set operation $INSERT$ on a singly linked list in $O(1)$ time? How about $DELETE$?
asked
in
Algorithms
Jun 30, 2019
217
views
cormen
data-structure
linked-lists
descriptive
4
votes
2
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
in
Algorithms
Jun 28, 2019
746
views
cormen
data-structure
stack
descriptive
0
votes
1
answer
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
in
Algorithms
Jun 28, 2019
239
views
cormen
data-structure
queue
descriptive
0
votes
1
answer
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
in
Algorithms
Jun 28, 2019
1.1k
views
cormen
algorithm
data-structure
queue
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
in
Algorithms
Jun 28, 2019
196
views
cormen
data-structure
queue
descriptive
0
votes
1
answer
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
in
Algorithms
Jun 28, 2019
250
views
cormen
data-structure
queue
descriptive
1
vote
1
answer
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
in
Algorithms
Jun 28, 2019
920
views
cormen
data-structure
stack
descriptive
1
vote
1
answer
15
Cormen Edition 3 Exercise 10.1 Question 1 (Page No. 235)
STACK-EMPTY(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 STACK-EMPTY(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
in
Algorithms
Jun 28, 2019
300
views
cormen
data-structure
stack
descriptive
0
votes
1
answer
16
Cormen Edition 3 Exercise 9.1 Question 2 (Page No. 215)
Prove the lower bound of $\lceil 3n/2\rceil – 2$ comparisons in the worst case to find both the maximum and minimum of $n$ numbers. (Hint: Consider how many numbers are potentially either the maximum or minimum and investigate how a comparison affects these counts.)
asked
in
Algorithms
Jun 28, 2019
308
views
cormen
algorithm
descriptive
0
votes
2
answers
17
Cormen Edition 3 Exercise 9.1 Question 1 (Page No. 215)
Show that the second smallest of $n$ elements can be found with $n+\lceil lg\ n \rceil -2$ comparisons in the worst case. (Hint: Also find the smallest element.)
asked
in
Algorithms
Jun 28, 2019
221
views
cormen
algorithm
descriptive
1
vote
0
answers
18
Cormen Edition 3 Exercise 8.4 Question 5 (Page No. 204)
A probability distribution function $P(x)$ for a random variable $X$ is defined by $P(x) =Pr\{X\leq x\}$.Suppose that we draw a list of $n$ random variables $X_1,X_2,…,X_n$ from a continuous probability distribution function $P$ that is computable in $O(1)$ time. Give an algorithm that sorts these numbers in linear averagecase time.
asked
in
Algorithms
Jun 28, 2019
318
views
cormen
algorithm
sorting
bucketsort
descriptive
difficult
0
votes
0
answers
19
Cormen Edition 3 Exercise 8.4 Question 4 (Page No. 204)
We are given $n$ points in the unit circle, $P_i=(x_i,y_i)$, such that $0<x_i^2+y_i^2<1$ for $i=1,2, .,n$.Suppose that the points are uniformly distributed; that is, the probability of finding a point in ... the origin. (Hint: Design the bucket sizes in BUCKET-SORT to reflect the uniform distribution of the points in the unit circle.)
asked
in
Algorithms
Jun 28, 2019
327
views
cormen
algorithm
sorting
bucketsort
descriptive
difficult
1
vote
1
answer
20
Cormen Edition 3 Exercise 8.4 Question 3 (Page No. 204)
Let $X$ be a random variable that is equal to the number of heads in two flips of a fair coin. What is $E[X^2]$? What is $E^2[X]$?
asked
in
Algorithms
Jun 28, 2019
261
views
cormen
algorithm
sorting
bucketsort
expectation
descriptive
Page:
1
2
3
4
5
6
...
28
next »
Ask a Question
Subscribe to GATE CSE 2023 Test Series
Subscribe to GO Classes for GATE CSE 2023
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 I became an IITian !
IIT Bombay & Delhi, MS interview Experience (MINDS & CMINDS)
IIIT Hyderabad MS Interview Experience
IIITA MTech IT 2022 new course structure and curriculum
Interview for Self sponsored category CSE at IIT Hyderabad
Categories
All categories
General Aptitude
(2.3k)
Engineering Mathematics
(8.8k)
Digital Logic
(3.2k)
Programming and DS
(5.4k)
Algorithms
(4.6k)
Theory of Computation
(6.4k)
Compiler Design
(2.3k)
Operating System
(4.8k)
Databases
(4.4k)
CO and Architecture
(3.6k)
Computer Networks
(4.4k)
Non GATE
(1.2k)
Others
(1.9k)
Admissions
(642)
Exam Queries
(837)
Tier 1 Placement Questions
(18)
Job Queries
(72)
Projects
(9)
Unknown Category
(1.0k)
Follow @gateoverflow
GATE Overflow
Recent Blog Comments
Best of luck & Thanks!!!We can connect in...
Congratulations! and relateOP :}
Congratulation buddy !! Wish u all the bestI can...
Please add your additional round A responses...
Use code SWFFGU to get maximum #discount on...
Network Sites
GO Mechanical
GO Electrical
GO Electronics
GO Civil
CSE Doubts
Aptitude Overflow
Search GATE Overflow for GATE CSE