Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged linked-list
1
votes
1
answer
91
TIFR CSE 2021 | Part B | Question: 2
Let $L$ be a singly-linked list $X$ and $Y$ be additional pointer variables such that $X$ points to the first element of $L$ and $Y$ points to the last element of $L$. Which of the following operations cannot be done in time that is ... after the last element of $L$. Add an element before the first element of $L$. Interchange the first two elements of $L$.
Let $L$ be a singly-linked list $X$ and $Y$ be additional pointer variables such that $X$ points to the first element of $L$ and $Y$ points to the last element of $L$. Wh...
soujanyareddy13
784
views
soujanyareddy13
asked
Mar 25, 2021
DS
tifr2021
data-structures
linked-list
+
–
8
votes
3
answers
92
GATE Overflow Test Series | Data Structures | Test 1 | Question: 10
Which of the following statements is TRUE regarding a doubly linked list? It is possible to implement a doubly linked list with a single pointer at each node by storing XOR of addresses of previous and next nodes. ... of current node and previous node We need minimum two pointers at each node for a doubly linked list implementation
Which of the following statements is TRUE regarding a doubly linked list?It is possible to implement a doubly linked list with a single pointer at each node by storing XO...
gatecse
621
views
gatecse
asked
Aug 9, 2020
DS
go2025-ds-1
linked-list
+
–
4
votes
1
answer
93
GATE Overflow Test Series | Data Structures | Test 1 | Question: 11
Let $L$ be a linked list of $n$ elements and $I$ be another linked list of $k$ node positions in $L$ ($n/4 < k < n/2)$ and elements in $I$ are not necessarily in sorted order. The best possible algorithm (use $O(1)$ extra space if ... $I$ will run in _____ $\Theta(n)$ $\Theta (n \log n)$ $\Theta (n .k \log k) $ $\Theta (nk)$
Let $L$ be a linked list of $n$ elements and $I$ be another linked list of $k$ node positions in $L$ ($n/4 < k < n/2)$ and elements in $I$ are not necessarily in sorted o...
gatecse
663
views
gatecse
asked
Aug 9, 2020
DS
go2025-ds-1
linked-list
+
–
3
votes
2
answers
94
GATE Overflow Test Series | Data Structures | Test 1 | Question: 13
void fun(struct node* start) { if(start == NULL) return; if(start->next != NULL ) fun(start->next->next); printf("%d ", start->data); } The sum of the values printed by the above function when passed with the head to the following linked list is _____ $1\to2\to 3\to 4\to 5\to 6\to 7$
void fun(struct node* start) { if(start == NULL) return; if(start->next != NULL ) fun(start->next->next); printf("%d ", start->data); }The sum of the values printed by th...
gatecse
250
views
gatecse
asked
Aug 9, 2020
DS
go2025-ds-1
numerical-answers
linked-list
+
–
3
votes
1
answer
95
GATE Overflow Test Series | Data Structures | Test 1 | Question: 14
Consider the following C function to traverse a linked list. void traverse(struct node *root) { while (root) { printf("%d ", root->data); root = root->next; } } Which of the following is ... of the linked list The function is implemented correctly and print all the values of the linked list starting from root
Consider the following C function to traverse a linked list.void traverse(struct node *root) { while (root) { printf("%d ", root->data); root = root->next; } }Which of th...
gatecse
302
views
gatecse
asked
Aug 9, 2020
DS
go2025-ds-1
linked-list
+
–
1
votes
2
answers
96
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 ofno pointer$1$ pointer$2$ pointers$3$ pointers
admin
908
views
admin
asked
Apr 2, 2020
DS
nielit2016mar-scientistc
data-structures
linked-list
+
–
2
votes
1
answer
97
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 characterContain address of next pointerBoth $\left (A \right)$ and $\left ( B \right)$
admin
4.4k
views
admin
asked
Mar 31, 2020
DS
nielit2017dec-assistanta
data-structures
linked-list
+
–
5
votes
0
answers
98
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",h...
admin
2.0k
views
admin
asked
Mar 30, 2020
DS
nielit2017july-scientistb-cs
data-structures
linked-list
+
–
4
votes
0
answers
99
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 $\text...
admin
1.6k
views
admin
asked
Mar 30, 2020
DS
nielit2017july-scientistb-cs
data-structures
linked-list
+
–
0
votes
1
answer
100
UGC NET CSE | June 2005 | Part 2 | Question: 21
What is the time required to insert an element in a stack with linked implementation? $O \left(\log_{2}n \right)$ $O \left(n \right)$ $O \left(n \log_{2}n \right)$ $O \left(1 \right)$
What is the time required to insert an element in a stack with linked implementation?$O \left(\log_{2}n \right)$$O \left(n \right)$$O \left(n \log_{2}n \right)$$O \left(1...
go_editor
335
views
go_editor
asked
Mar 26, 2020
DS
ugcnetcse-june2005-paper2
data-structures
linked-list
stack
+
–
36
votes
9
answers
101
GATE CSE 2020 | 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...
Arjun
26.5k
views
Arjun
asked
Feb 12, 2020
DS
gatecse-2020
linked-list
1-mark
+
–
0
votes
0
answers
102
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 ...
akash.dinkar12
651
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
difficult
+
–
0
votes
1
answer
103
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 need...
akash.dinkar12
921
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
1
votes
1
answer
104
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...
akash.dinkar12
604
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
1
votes
1
answer
105
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?
akash.dinkar12
618
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
0
votes
0
answers
106
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 xAs written, each loop iteration in the LIST-SEARCH’ procedure requires tw...
akash.dinkar12
392
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
1
votes
2
answers
107
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.
akash.dinkar12
405
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
1
votes
1
answer
108
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.
akash.dinkar12
401
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
0
votes
1
answer
109
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$?
akash.dinkar12
520
views
akash.dinkar12
asked
Jun 30, 2019
Algorithms
cormen
data-structures
linked-list
descriptive
+
–
0
votes
0
answers
110
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...
Arun Rout
596
views
Arun Rout
asked
May 24, 2019
DS
linked-list
+
–
0
votes
2
answers
111
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
srestha
740
views
srestha
asked
Apr 29, 2019
DS
linked-list
data-structures
+
–
1
votes
0
answers
112
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...
srestha
1.2k
views
srestha
asked
Mar 2, 2019
Programming in C
array
linked-list
+
–
0
votes
3
answers
113
UPPCL AE 2018:60
The following function attempts to merge two sorted linked lists. ListNode is the custom structure representing a node in the linked list. ListNode* Merge(ListNode* pHead1, ListNode* pHead2) { ListNode* pMergedHead = NULL; if (pHead1->m_nValue < pHead2->m_nValue) { pMergedHead = pHead1; ... $\text{II} $ and $\text{III}$ $\text{I} $ and $\text{III}$ $\text{I}$ only
The following function attempts to merge two sorted linked lists. ListNode is the custom structure representing a node in the linked list.ListNode* Merge(ListNode* pHead1...
admin
434
views
admin
asked
Jan 5, 2019
DS
uppcl2018
data-structures
linked-list
+
–
1
votes
2
answers
114
UGC NET CSE | December 2018 | Part 2 | Question: 29
Consider a singly linked list. What is the worst case time complexity of the best-known algorithm to delete the node $a$, pointer to this node is $q$, from the list? $O(n \lg \: n)$ $O(n)$ $O(\lg \: n)$ $O(1)$
Consider a singly linked list. What is the worst case time complexity of the best-known algorithm to delete the node $a$, pointer to this node is $q$, from the list?$O(n ...
Arjun
2.9k
views
Arjun
asked
Jan 2, 2019
Unknown Category
ugcnetcse-dec2018-paper2
data-structures
linked-list
time-complexity
+
–
6
votes
1
answer
115
GATE Overflow | Mock GATE | Test 1 | Question: 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{Inse...
Ruturaj Mohanty
1.6k
views
Ruturaj Mohanty
asked
Dec 27, 2018
Algorithms
go-mockgate-1
data-structures
linked-list
sorting
algorithms
+
–
1
votes
3
answers
116
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) ;...
sharadsingh
1.1k
views
sharadsingh
asked
Dec 27, 2018
DS
linked-list
data-structures
programming-in-c
+
–
1
votes
1
answer
117
selfdoub
Shubham Aggarwal
297
views
Shubham Aggarwal
asked
Dec 26, 2018
DS
data-structures
linked-list
+
–
2
votes
0
answers
118
Gateforum Test Series: Programming & DS - Linked Lists
Gupta731
661
views
Gupta731
asked
Dec 24, 2018
DS
gateforum-test-series
data-structures
linked-list
+
–
2
votes
1
answer
119
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 ...
Mk Utkarsh
1.1k
views
Mk Utkarsh
asked
Dec 5, 2018
DS
linked-list
data-structures
+
–
1
votes
1
answer
120
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 ... 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 posi...
Ashish Roy 1
3.6k
views
Ashish Roy 1
asked
Dec 3, 2018
DS
made-easy-test-series
data-structures
linked-list
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register