Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged linked-list
0
votes
1
answer
1
Linked List
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
Mrityudoot
144
views
Mrityudoot
asked
Feb 25
Programming in C
linked-list
data-structures
algorithms
+
–
4
votes
1
answer
2
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 34
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue is at the head of the list. What is the best possible worst-case running ... $O(n)$ for dequeue. $O(n)$ for enqueue and $O(1)$ for dequeue. $O(n)$ for both functions.
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue ...
GO Classes
333
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
data-structures
queue
linked-list
1-mark
+
–
0
votes
1
answer
3
Memory Based GATE DA 2024 | Question: 24
Consider a doubly linked list with the following operations: - Insert First (\texttt{InsertFirst}) \\ - Insert Last (\texttt{InsertLast}) \\ - Remove First (\texttt{RemoveFirst}) \\ - Remove Last (\texttt{RemoveLast}) The following operations are ... \ & a = \text{RemoveLast} \end{aligned} \] What is the value of \(a\) after these operations?
Consider a doubly linked list with the following operations:- Insert First (\texttt{InsertFirst})\\- Insert Last (\texttt{InsertLast})\\- Remove First (\texttt{RemoveFirs...
GO Classes
159
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
linked-list
numerical-answers
+
–
4
votes
2
answers
4
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 37
Consider the null-terminated linked list of four integers $\textsf{1->2->3->4->NULL},$ and the variable 'list' points to the head of the linked list. Upon running the provided code, the linked list gets divided ... X:list->next->next>next = list->next>next; LINE Y: list = list->next->next;
Consider the null-terminated linked list of four integers $\textsf{1->2->3->4->NULL},$ and the variable 'list' points to the head of the linked list. Upon running the pro...
GO Classes
387
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
linked-list
2-marks
+
–
3
votes
1
answer
5
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 3
The Euclidean algorithm is used to find the greatest common divisor $(\mathrm{gcd})$ of two positive integers $\mathrm{a}$ and $\mathrm{b}$. input(a) input(b) while b>0 begin r:= a mod b a:= b b:= r end gcd:= a output(gcd) When the algorithm ... is the sequence of computed values for $r?$ $2,53,1,0$ $53,2,1,0$ $53,4,1,0$ $53,5,1,0$
The Euclidean algorithm is used to find the greatest common divisor $(\mathrm{gcd})$ of two positive integers $\mathrm{a}$ and $\mathrm{b}$.input(a) input(b) while b>0 be...
GO Classes
352
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
data-structures
linked-list
1-mark
+
–
2
votes
1
answer
6
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 53
Consider the linked list initially having values $1, 2, 2, 8, 6, 2, 2,$ and let the head be the pointer to the first node of the linked list. Which of the following options correctly represents the final linked list after the function call ... LinkedList will be $1, 8, 6$ Final LinkedList will be $1, 8, 6, 2, 2$ None of the above
Consider the linked list initially having values $1, 2, 2, 8, 6, 2, 2,$ and let the head be the pointer to the first node of the linked list.Which of the following option...
GO Classes
317
views
GO Classes
asked
Jan 13
DS
goclasses2024-mockgate-11
goclasses
data-structures
linked-list
2-marks
+
–
0
votes
0
answers
7
Made Easy Test Series 2024
Suppose we have a directed graph G = (V,E) with V= {1, 2, ..., n} and Eis presented as an adjacency list. For each vertex u in V, out(u) is a list such that (u, v) in {1, 2, ... k). For each u in V, we wish to compute a corresponding list in(u) =such that in E ... take to construct the lists in(u), u in V, from the lists out(u), u in V? T(n) =O(n+m) B. T(n)= O(n(m+n))
Suppose we have a directed graph G = (V,E) with V= {1, 2, ..., n} and Eis presented as an adjacency list. For each vertex u in V, out(u) is a list such that (u, v) in {1,...
Ray Tomlinson
506
views
Ray Tomlinson
asked
Aug 9, 2023
Algorithms
made-easy-test-series
algorithms
made-easy-booklet
algorithm-design
time-complexity
linked-list
graph-theory
graph-algorithm
+
–
0
votes
1
answer
8
self-doubt Data structure Linked list. Inserting a node at the beginning of a linked list
How to Visualize this code ? #include<stdio.h> #include<stdlib.h> struct node{ int data; struct node *next; }; void addFirst(struct node **head,int val){ struct node *newNode =malloc(sizeof(struct node ... ); addFirst(&head,30); addFirst(&head,40); addFirst(&head,50); printList(head); }
How to Visualize this code ?#include<stdio.h #include<stdlib.h struct node{ int data; struct node *next; }; void addFirst(struct node head,int val){ struct node *newNode...
gagan55
874
views
gagan55
asked
Jul 13, 2023
DS
data-structures
linked-list
+
–
0
votes
0
answers
9
Gate Overflow Test series
Can anyone explain this question to me
Can anyone explain this question to me
priyansh_1705
384
views
priyansh_1705
asked
Jul 3, 2023
Programming in C
linked-list
data-structures
+
–
1
votes
1
answer
10
GO Classes 2023 | IIITH Mock Test 1 | Question: 44
Consider a sorted circular doubly-linked list where the head element points to the smallest element in the list. Which of the following(s) is/are true? Asymptotic time complexity of finding the smallest element in the list is $O(1)$ Asymptotic ... complexity of deleting a given element e in the list (not including the cost of finding it) is $O(1)$
Consider a sorted circular doubly-linked list where the head element points to the smallest element in the list. Which of the following(s) is/are true?Asymptotic time com...
GO Classes
799
views
GO Classes
asked
Mar 26, 2023
DS
goclasses2023-iiith-mock-1
goclasses
data-structures
linked-list
multiple-selects
1-mark
+
–
Page:
1
2
3
4
5
6
...
9
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register