The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
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 linkedlists
0
votes
1
answer
1
Linked list
What does the following program do on two linked lists? Struct node *myFun (struct node * a, struct node * b) { Struct node *new = NULL ; If (a = = NULL) return (b) ; if (b = = NULL) return (a) ; If (a → data <= ... two linked lists by selecting the alternate nodes merges two sorted linked lists into final sorted linked list merges two linked lists by selecting the nodes in reverse.
asked
Dec 27, 2018
in
DS
by
sharadsingh
(
21
points)

45
views
linkedlists
datastructure
programminginc
0
votes
1
answer
2
NTA NET DEC18 Q6
asked
Dec 25, 2018
in
Algorithms
by
Sanjay Sharma
Veteran
(
50.2k
points)

56
views
linkedlists
0
votes
0
answers
3
Testbook  Linked List
int find (struct node * first, int n) { while (first data ! = n) first = first — next; if (first data = = n) return(1); else return (1); in the above code segment if the value of 'n' is 5, then the function return 1, but if the value of 'n' is 9, then what does it do ?
asked
Dec 5, 2018
in
DS
by
Mk Utkarsh
Boss
(
33k
points)

93
views
linkedlists
datastructure
0
votes
0
answers
4
Circular Link List Insertion and Deletion
Suppose a circular queue of capacity (n  1) elements is implemented with an array of n elements. Now, in this queue what will be condition for FULL and EMPTY? Full:(REAR+1)%n== FRONT (or) (FRONT+1)%n==REAR (or) FRONT==REAR Empty: ... So, in case of Full, Rear point array that must be array index more than Front Am I right? Then what equation will valid?
asked
Nov 20, 2018
in
Programming
by
srestha
Veteran
(
106k
points)

54
views
linkedlists
datastructure
0
votes
0
answers
5
Karumanchi
There is a singly linked list. We have a pointer to a particular node(it is not tail node). what is the time and space complexity required to delete this node? my approach is... As there is no previous pointer so we traverse the list from the starting to just ... complexity as O(n) and space complexity O(1). but in the book the time complexity is mentioned O(1) where am I going wrong?
asked
Nov 20, 2018
in
DS
by
aditi19
Active
(
2.2k
points)

42
views
timecomplexity
linkedlists
datastructure
0
votes
1
answer
6
Reversing Singly Linked List
To reverse a Singly Linked List is the below is correct code? (or) need to change Struct node *reverse(struct node *start) { Struct node *prev,*ptr,*next; prev=NULL; ptr=start; while(ptr!=NULL) { next=ptr>link; ptr>link=prev; prev=ptr; ptr=next; } start=prev; return start; Plz tell me, is here all link updating correctly?
asked
Nov 19, 2018
in
Programming
by
srestha
Veteran
(
106k
points)

66
views
linkedlists
datastructure
0
votes
0
answers
7
Linked list Quiz
Consider an unrolled linked list with $n$ elements.This list stores multiple elements in each node. What is the worst case time complexity to find the $k^{th}$ element if the number of nodes and the number of elements in each node are equal? $A)O(n)$ $B)O(\sqrt n)$ $C)O(nlogn)$ $D)O(n^{2})$
asked
Nov 18, 2018
in
Programming
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

100
views
datastructure
linkedlists
0
votes
0
answers
8
Intersection among elements of Linked List
Given two unsorted singlylinked lists each with n distinct elements. There exists an efficient intersection algorithm, that computes and returns a new list with common elements between the input lists. How much time does the intersection algorithm requires in worst case, if it is allowed to use constant extra space only?
asked
Nov 4, 2018
in
DS
by
srestha
Veteran
(
106k
points)

174
views
linkedlists
datastructure
0
votes
0
answers
9
GATEBOOK2019DS117
Consider following function for a given Linked List $L$ as: $head\rightarrow[1]\rightarrow[2]\rightarrow[3]\rightarrow[4]\rightarrow[6]\rightarrow[5]\rightarrow[7]$, which is pointed to by a $\text{head}$ pointer. (Assume the type of $\text{head}$ as $\text{struct node *}$ which is already defined.) void foo( ... $7 \: 5 \: 3 \: 1$ $7 \: 6 \: 5 \: 4 \: 3 \: 2 \: 1$
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

86
views
gb2019ds1
linkedlists
+1
vote
0
answers
10
GATEBOOK2019DS118
Consider the following function processing a doubly linked list. void magic(struct node **headptr) { struct node *temp = NULL; struct node *curr = *headptr; while (curr != NULL) { temp = curr > prev; curr > prev = curr > next; curr ... $\text{None of the above}$
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

97
views
gb2019ds1
linkedlists
0
votes
0
answers
11
GATEBOOK2019DS119
Which of the following sorting algorithms best suits to sort a set of integer data items stored in nodes of a doubly linked list, with minimum worst case time complexity? Merge Sort Heap Sort Quick Sort Insertion Sort
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

118
views
gb2019ds1
linkedlists
0
votes
1
answer
12
GATEBOOK2019DS121
Consider a singly circular linked list with a pointer $ \text{head} $ pointing to the first node of the linked list. What are the time complexities of finding $k^{th}$ element from beginning and $k^{th}$ element from end in a singly linked list (where $k$ is some number less than the size of ... $O(1) \text{and }O(1)$ $O(n) \text{and } O(1)$ $O(1) \text{and } O(n)$
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

58
views
gb2019ds1
linkedlists
0
votes
0
answers
13
GATEBOOK2019DS123
Consider a doubly linked list shown below: $\text{head} \rightarrow [1] \leftrightarrow [2] \leftrightarrow [3] \leftrightarrow [4] \leftrightarrow [5] \leftrightarrow [6] \leftrightarrow [7] $. Consider the function $change()$ defined below, where $ \text{head}$ points to the first node in the linked list: void ... $7 \: 6 \: 5 \: 3 \:1$ $6\: 7 \: 5 \: 3 \: 1$
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

70
views
gb2019ds1
linkedlists
+1
vote
0
answers
14
GATEBOOK2019DS124
Consider the function foo defined below. bool foo(struct node *p) { if (p == NULL)  (p → next == NULL)  (( P→ data < p → next→ data) && foo(p → next)) return true; else return false; } For a given linked ... the elements in the list are sorted in nonincreasing order of data value the elements in the list are sorted in strictly increasing order of data value
asked
Oct 27, 2018
in
Programming
by
GATEBOOK
Boss
(
12.7k
points)

53
views
gb2019ds1
linkedlists
0
votes
0
answers
15
Linked list implementation of Previous
Consider the following function: Find(Element Type X,List L) { Position Prev_Pos,XPos; Prev_Pos=Find Previous(X,L); if(Prev_Pos>Next!=NULL) /* found */ { XPos=Prev_Pos>Next; Prev_Pos>Next=XPos>Next; ... lists $B)$Linked list implementation of singly linked lists $C)$Linked list implementation of doubly linked lists $D)$None of these
asked
Oct 26, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

39
views
datastructure
linkedlists
0
votes
0
answers
16
Reverse Linked list
What is the time complexity of the bestknown algorithm to reverse a doubly linked list? $A) O(n)$ $B) O(logn)$ $C) O(1)$ $D) O(n^{2})$
asked
Oct 26, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

48
views
datastructure
linkedlists
0
votes
0
answers
17
IISCCDS Written Test Sample Question
asked
Oct 25, 2018
in
Programming
by
Sayan Bose
Loyal
(
5.2k
points)

90
views
iisc
cds
linkedlists
0
votes
1
answer
18
Linked list insertion
In a linked list with $n$ nodes, the time taken to insert an element after an element pointed by some pointer is: $(A) O(1)$ $(B) O(logn)$ $(C) O(n)$ $(D) O(nlogn)$
asked
Oct 17, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

74
views
datastructure
linkedlists
+1
vote
0
answers
19
Linked list
If the head of a Linked List is pointing to $k$ th element, then how will you get the elements before $k$ th element?
asked
Oct 17, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

51
views
datastructure
linkedlists
0
votes
0
answers
20
Linked List Data Structures And Algorithms Made Easy By Narasimha Karumanchi
Suppose there are two singly linked lists both of which intersect at some point and become a single linked list. The head or start pointers of both the lists are known, but the intersecting node is not known. ... ; n. Give an algorithm for finding the merging point. And find the time complexity and space complexity also.
asked
Oct 17, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
26.4k
points)

61
views
datastructure
linkedlists
0
votes
1
answer
21
Doubt
can anyone explain in detail why and how is merge sort optimal for linked list?
asked
Sep 26, 2018
in
DS
by
aditi19
Active
(
2.2k
points)

36
views
linked
linkedlists
merge
mergesort
0
votes
1
answer
22
conceptual doubt
WHAT IS THE TIME COMPLEXITY TO ENQUEUE AN ELEMENT IF THE QUEUE IS IMPLEMENTED AS A CIRCULAR QUEUE AND WE HAVE GOT ONLY ONE POINTER TO FRONT ELEMENT??
asked
Sep 20, 2018
in
DS
by
sushmita
Boss
(
16.5k
points)

132
views
datastructure
linkedlists
timecomplexity
queues
0
votes
0
answers
23
Linked List Problem
struct node* foo(struct node* a, struct node* b) { struct node* result, *rec; if(a==null) return b; else if(b==null) return a; else { rec=foo(a>next,b>next); result=a; a>next=b; b>next=rec; return result; } }
asked
Sep 17, 2018
in
Programming
by
Vaishnavi01
(
217
points)

69
views
datastructure
linkedlists
algorithms
0
votes
0
answers
24
Test series
The answer is 'd' will be printed. Can someone draw the linked list after the operations are performed. I think the second operation of the code doesn't bring in any change to the list. thanks in advance
asked
Aug 23, 2018
in
Programming
by
Kalpataru Bose
(
497
points)

48
views
madeeasytestseries
testbooktestseries
linkedlists
datastructure
programminginc
0
votes
1
answer
25
Link list
Suppose we are deleting a node with data field as x. Which can be present anywhere in the list. Consider following Scenarios : S1 : You're only provided with pointer to the node which needs to be deleted. S2 : You're only provided with the pointer to the starting ... cases for S2. D. Deletion is not possible for certain cases in S2, but deletion is possible in all cases for S1. Ans. C
asked
Aug 22, 2018
in
DS
by
Na462
Loyal
(
8k
points)

42
views
linkedlists
datastructure
0
votes
1
answer
26
Linked List
What kind of linked list is best to answer question like “What is the item at position n?” a) Singly linked list b) Doubly linked list c) Circular linked list d) Array implementation of linked list
asked
Aug 19, 2018
in
Programming
by
pradeepchaudhary
Active
(
1k
points)

83
views
linkedlists
datastructure
algorithms
0
votes
0
answers
27
Linked list
Function to reverse the circular doubly linked list. Why is this function showing an error? head is a global variable. void reverse() { struct node *z; struct node *t = head > forw; while(t != head) { z=t>back; t>back=t>forw; t>forw=z; t = t > back; } z=t>back; t>back=t>forw; t>forw=z; head=t>forw; }
asked
Aug 6, 2018
in
Programming
by
rishabhgupta12
(
65
points)

83
views
linkedlists
datastructure
+2
votes
2
answers
28
Linked list
How to trace the below program? p and q are the starting address of two different linked list struct node*Do(struct node*p,struct node*q){ struct node*ps,*qs; if(!p){ return(q); } else if(!q){ return(p); } else{ ps=p>link; qs=q>link; p>link=q; q>link=Do(ps,qs); return(p); } }
asked
Aug 3, 2018
in
Programming
by
rishabhgupta12
(
65
points)

72
views
linkedlists
recursion
+1
vote
1
answer
29
Asymptotic time complexity to add a node at the end of singly linked list.
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list? (a) O(1) (b) O(n) (c) θ (n) (d) θ (1) Confused between option (b) and (c) .
asked
Jul 4, 2018
in
Algorithms
by
arya_stark
Active
(
1.4k
points)

194
views
datastructure
algorithms
linkedlists
+1
vote
1
answer
30
SelfDoubt
In a circular linked list last node points to the : $Head$ $Tail$ $First Node$
asked
May 27, 2018
in
Programming
by
Phlegmatic
(
259
points)

151
views
datastructure
circularlinkedlist
linkedlists
Page:
1
2
3
4
5
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
Decidability Slides
How to Revise?
AAI JE IT results out! Adv no 02/2018
Graph Theory Slides for GATECSE
Generating Function Useful Link
Follow @csegate
Gatecse
Recent questions tagged linkedlists
Recent Blog Comments
@arjun sir along with this are there any other...
Thanks :)
You don't have to be,I know what you are going...
Thank you sir!
Thanks @sripo man, that what i was looking for....
46,785
questions
51,233
answers
176,568
comments
66,584
users