menu
Login
Register
search
Log In
account_circle
Log In
Email or Username
Password
Remember
Log In
Register
I forgot my password
Register
Username
Email
Password
Register
add
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
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
Barc Interview Experience 2020- CSE stream
JEST 2021 registrations are open
TIFR GS-2021 Online Application portal
IIT Jodhpur Mtech AI - Interview Expierence (Summer Admission)
Interview experience at IIT Tirupati for MS program winter admission
Subjects
All categories
General Aptitude
(2.1k)
Engineering Mathematics
(8.5k)
Digital Logic
(3k)
Programming and DS
(5.1k)
Algorithms
(4.5k)
Theory of Computation
(6.3k)
Compiler Design
(2.2k)
Operating System
(4.7k)
Databases
(4.3k)
CO and Architecture
(3.5k)
Computer Networks
(4.3k)
Non GATE
(1.2k)
Others
(1.3k)
Admissions
(595)
Exam Queries
(838)
Tier 1 Placement Questions
(16)
Job Queries
(71)
Projects
(19)
Unknown Category
(1.1k)
Recent questions tagged linked-lists
Recent Blog Comments
hi this pdf have gate prevoius year questions or...
Thanks, dude for sharing your experience !! It...
Congratulations, at least you made it to the...
seems like you really enjoyed the process.......
I wrote an email to IISC regarding JEST 2021 but...
Network Sites
GO Mechanical
GO Electrical
GO Electronics
GO Civil
CSE Doubts
Recent questions tagged linked-lists
0
votes
1
answer
1
NIELIT 2016 MAR Scientist C - Section C: 54
In a circularly linked list organization, insertion of a record involves the modification of no pointer $1$ pointer $2$ pointers $3$ pointers
In a circularly linked list organization, insertion of a record involves the modification of no pointer $1$ pointer $2$ pointers $3$ pointers
asked
Apr 2, 2020
in
DS
Lakshman Patel RJIT
183
views
nielit2016mar-scientistc
data-structures
linked-lists
1
vote
1
answer
2
NIELIT 2017 DEC Scientific Assistant A - Section B: 52
The address field of linked list : Contain address of next node May contain null character Contain address of next pointer Both $\left (A \right)$ and $\left ( B \right)$
The address field of linked list : Contain address of next node May contain null character Contain address of next pointer Both $\left (A \right)$ and $\left ( B \right)$
asked
Mar 31, 2020
in
DS
Lakshman Patel RJIT
768
views
nielit2017dec-assistanta
data-structures
linked-lists
2
votes
1
answer
3
NIELIT 2017 July Scientist B (CS) - Section B: 1
What does the following function do for a given Linked List with first node as head? void fun1(struct node* head) { if(head==NULL) return; fun1(head->next); printf("%d",head->data); } Prints all ... lists Prints all nodes of linked list in reverse order Prints alternate nodes of Linked List Prints alternate nodes in reverse order
What does the following function do for a given Linked List with first node as head? void fun1(struct node* head) { if(head==NULL) return; fun1(head->next); printf("%d",head->data); } Prints all nodes of linked lists Prints all nodes of linked list in reverse order Prints alternate nodes of Linked List Prints alternate nodes in reverse order
asked
Mar 30, 2020
in
DS
Lakshman Patel RJIT
477
views
nielit2017july-scientistb-cs
data-structures
linked-lists
1
vote
1
answer
4
NIELIT 2017 July Scientist B (CS) - Section B: 3
Consider the following function that takes reference to head of a Doubly Linked List as parameter. Assume that a node of doubly linked list has previous pointer as $\textit{prev}$ and next pointer as $\textit{next}$. ... $6 \leftrightarrow 5 \leftrightarrow 4 \leftrightarrow 3 \leftrightarrow 1 \leftrightarrow 2$
Consider the following function that takes reference to head of a Doubly Linked List as parameter. Assume that a node of doubly linked list has previous pointer as $\textit{prev}$ and next pointer as $\textit{next}$. void fun(struct node ** ... $6 \leftrightarrow 5 \leftrightarrow 4 \leftrightarrow 3 \leftrightarrow 1 \leftrightarrow 2$
asked
Mar 30, 2020
in
DS
Lakshman Patel RJIT
336
views
nielit2017july-scientistb-cs
data-structures
linked-lists
12
votes
10
answers
5
GATE 2020 CSE | Question: 16
What is the worst case time complexity of inserting $n$ elements into an empty linked list, if the linked list needs to be maintained in sorted order? $\Theta(n)$ $\Theta(n \log n)$ $\Theta ( n)^{2}$ $\Theta(1)$
What is the worst case time complexity of inserting $n$ elements into an empty linked list, if the linked list needs to be maintained in sorted order? $\Theta(n)$ $\Theta(n \log n)$ $\Theta ( n)^{2}$ $\Theta(1)$
asked
Feb 12, 2020
in
DS
Arjun
8.8k
views
gate2020-cs
linked-lists
0
votes
0
answers
6
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.
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$ to be $x.np=x.next$ $XOR$ $x.prev$, the $k$- ... to implement the $SEARCH$, $INSERT$, and $DELETE$ operations on such a list. Also, show how to reverse such a list in $O(1)$ time.
asked
Jun 30, 2019
in
Algorithms
akash.dinkar12
238
views
cormen
data-structures
linked-lists
descriptive
difficult
0
votes
1
answer
7
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.
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, 2019
in
Algorithms
akash.dinkar12
138
views
cormen
data-structures
linked-lists
descriptive
0
votes
1
answer
8
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.
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
Jun 30, 2019
in
Algorithms
akash.dinkar12
82
views
cormen
data-structures
linked-lists
descriptive
0
votes
0
answers
9
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?
Implement the dictionary operations $INSERT$, $DELETE$, and $SEARCH$ using singly linked, circular lists. What are the running times of your procedures?
asked
Jun 30, 2019
in
Algorithms
akash.dinkar12
105
views
cormen
data-structures
linked-lists
descriptive
0
votes
0
answers
10
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.
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
Jun 30, 2019
in
Algorithms
akash.dinkar12
67
views
cormen
data-structures
linked-lists
descriptive
0
votes
2
answers
11
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.
Implement a queue by a singly linked list $L$. The operations of $ENQUEUE$ and $DEQUEUE$ should still take $O(1)$ time.
asked
Jun 30, 2019
in
Algorithms
akash.dinkar12
96
views
cormen
data-structures
linked-lists
descriptive
0
votes
1
answer
12
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.
Implement a stack using a singly linked list $L$. The operations $PUSH$ and $POP$ should still take $O(1)$ time.
asked
Jun 30, 2019
in
Algorithms
akash.dinkar12
78
views
cormen
data-structures
linked-lists
descriptive
0
votes
0
answers
13
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$?
Can you implement the dynamic-set operation $INSERT$ on a singly linked list in $O(1)$ time? How about $DELETE$?
asked
Jun 30, 2019
in
Algorithms
akash.dinkar12
52
views
cormen
data-structures
linked-lists
descriptive
0
votes
0
answers
14
doubly linked linked list
why we use double pointer struct Node** head here? can anyone explain with details /* Given a reference (pointer to pointer) to the head of a DLL and an int, appends a new node at the end */ void append(struct Node** head_ref, int new_data) { struct Node* ... } while (last->next != NULL) last = last->next; last->next = new_node; new_node->prev = last; return; }
why we use double pointer struct Node** head here? can anyone explain with details /* Given a reference (pointer to pointer) to the head of a DLL and an int, appends a new node at the end */ void append(struct Node** head_ref, int new_data) { struct Node* new_node = ( ... new_node; return; } while (last->next != NULL) last = last->next; last->next = new_node; new_node->prev = last; return; }
asked
May 24, 2019
in
DS
Arun Rout
235
views
linked-lists
0
votes
2
answers
15
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
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, 2019
in
DS
srestha
198
views
linked-lists
data-structures
0
votes
0
answers
16
Locality of Rference(OS+DS) (ACE)
An OS uses virtual memory with paging technique for memory allocation. Which of the following searching technique on given data structure use locality of reference? Linear search on linked list Binary search on array Linear search on array Binary search on linked list
An OS uses virtual memory with paging technique for memory allocation. Which of the following searching technique on given data structure use locality of reference? Linear search on linked list Binary search on array Linear search on array Binary search on linked list
asked
Mar 2, 2019
in
Programming
srestha
396
views
arrays
linked-lists
4
votes
1
answer
17
GO2019-FLT1-62
Which of the following sorting algorithms performs efficiently to sort a singly linked list containing $\log n$ nodes and the corresponding time complexity is? $\text{Insertion sort, } O(\log ^2 n)$ $\text{Merge sort, } \Theta (( \log n) \log (\log n ))$ $\text{Heap sort, } \Theta ( \log ^2)(\log n ))$ $\text{Quick sort, } O ( \log 2)(\log n ))$
Which of the following sorting algorithms performs efficiently to sort a singly linked list containing $\log n$ nodes and the corresponding time complexity is? $\text{Insertion sort, } O(\log ^2 n)$ $\text{Merge sort, } \Theta (( \log n) \log (\log n ))$ $\text{Heap sort, } \Theta ( \log ^2)(\log n ))$ $\text{Quick sort, } O ( \log 2)(\log n ))$
asked
Dec 27, 2018
in
Algorithms
Ruturaj Mohanty
411
views
go2019-flt1
data-structures
linked-lists
sorting
algorithms
0
votes
1
answer
18
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.
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 <= b → ... merges 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
sharadsingh
220
views
linked-lists
data-structures
programming-in-c
1
vote
1
answer
19
NTA NET DEC18 Q6
asked
Dec 25, 2018
in
Algorithms
Sanjay Sharma
175
views
linked-lists
1
vote
0
answers
20
Gateforum Test Series: Programming & DS - Linked Lists
asked
Dec 24, 2018
in
DS
Gupta731
223
views
gateforum-test-series
data-structures
linked-lists
0
votes
0
answers
21
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 ?
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
Mk Utkarsh
297
views
linked-lists
data-structures
0
votes
1
answer
22
MadeEasy Test Series: Programming & DS - Linked Lists
You're entrusted with the task of deleting a node in a singly linkedlist, whose data field is 'x'. Note that, the node which is to be deleted can be at any arbitrary position in the linked list. Consider the following ... pointer to the starling node of the linked list. Which of the following options is correct? How deletion possible with S2?
You're entrusted with the task of deleting a node in a singly linkedlist, whose data field is 'x'. Note that, the node which is to be deleted can be at any arbitrary position in the linked list. Consider the following scenarios. S1. You're only provided ... provided with a pointer to the starling node of the linked list. Which of the following options is correct? How deletion possible with S2?
asked
Dec 3, 2018
in
DS
Ashish Roy 1
362
views
made-easy-test-series
data-structures
linked-lists
0
votes
0
answers
23
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?
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: FRONT==REAR (or) REAR== ... location as rear. 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
srestha
449
views
linked-lists
data-structures
0
votes
0
answers
24
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?
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 before the ... 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
aditi19
257
views
time-complexity
linked-lists
data-structures
0
votes
1
answer
25
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?
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
srestha
333
views
linked-lists
data-structures
1
vote
0
answers
26
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})$
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
Lakshman Patel RJIT
403
views
data-structures
linked-lists
0
votes
0
answers
27
Intersection among elements of Linked List
Given two unsorted singly-linked 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?
Given two unsorted singly-linked 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
srestha
515
views
linked-lists
data-structures
0
votes
0
answers
28
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
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; XPos--->Next=L--->Next; L- ... of self-adjusting 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
Lakshman Patel RJIT
167
views
data-structures
linked-lists
0
votes
0
answers
29
Reverse Linked list
What is the time complexity of the best-known algorithm to reverse a doubly linked list? $A) O(n)$ $B) O(logn)$ $C) O(1)$ $D) O(n^{2})$
What is the time complexity of the best-known 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
Lakshman Patel RJIT
358
views
data-structures
linked-lists
0
votes
0
answers
30
IISC-CDS Written Test Sample Question
asked
Oct 25, 2018
in
Programming
Sayan Bose
900
views
iisc
cds
linked-lists
Page:
1
2
3
4
5
6
next »
...