Recent questions tagged linked-list

0 0 votes
1 1 answer
1.1k
1.1k views
Why the following code is not giving desired results? The code simple push & appends the nodes in the linked list.#include <stdio.h #include <stdlib.h struct Node{ int it...
1 1 vote
3 3 answers
1.1k
1.1k views
we know that pointer implementation is not possible in java and dynamic memory allocation is also not possible.Then how we can implement linked list in java?
0 0 votes
1 answers 1 answer
4.4k
4.4k views
Insertion of a node into a doubly linked list requires how many changes to various Next and Previous Pointer?A. No ChangeB. 1 Next , 1 PreviousC. 2 Next , 2 PreviousD. 3 ...
3 3 votes
4 4 answers
59.4k
59.4k views
Which of the following is true about linked list implementation of queue?(a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop ope...
0 0 votes
2 2 answers
4.4k
4.4k views
Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?(a) Deleting a node whose location in given(b) Searching ...
1 1 vote
1 1 answer
534
534 views
Linked Lists are not suitable for :Binary SearchPolynomial ManipulationInsertionRadix Sort
8 8 votes
4 4 answers
16.5k
16.5k views
Given two statementsInsertion of an element should be done at the last node of the circular listDeletion of an element should be done at the last node of the circular lis...
4 4 votes
4 4 answers
19.7k
19.7k views
In a doubly linked list the number of pointers affected for an insertion operation will be401Depends on the nodes of doubly linked list
4 4 votes
1 answers 1 answer
2.4k
2.4k views
I was trying to implement the Linked List code in C. It compiles fine but doesn't give any output. What seems to be the error? I think I messed up at passing pointer refe...
129 129 votes
18 answers 18 answers
45.1k
45.1k views
Consider the C code fragment given below.typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->ne...
0 0 votes
1 answers 1 answer
589
589 views
A linked list stores the numbers in sorted order.What will be the contents of a list after the following insert & delete operations are performed? insert(4) insert(2) ins...
0 0 votes
4 4 answers
3.0k
3.0k views
struct node{ int num; struct node *next; } void print(struct node *ptr) { if(ptr) { printf("%d",ptr->data); do{ printf("%d",ptr->data); } while(ptr->next); } }What is the...
6 6 votes
2 answers 2 answers
4.9k
4.9k views
Time complexity to insert a node in the end of circular linked list, if the pointer to the 1st node is given and number of nodes in list is NisA)O(1)B)O(log N)C)O(N)D)O(N...
3 3 votes
1 1 answer
4.9k
4.9k views
In a doubly linked list organization, insertion of a record in end involves modification of ____ for existing list.one pointertwo pointermultiple pointerno pointer
1 1 vote
1 answers 1 answer
1.9k
1.9k views
The Answer given is A) I think the naswer should be B) as we have both the prev pointer and the next pointer available , it will take constant time to update the adjacent...
39 39 votes
3 answers 3 answers
6.5k
6.5k views
Write a constant time algorithm to insert a node with data $D$ just before the node with address $p$ of a singly linked list.
4 4 votes
1 1 answer
1.6k
1.6k views
Express the following list in terms of a linked list structure suitable for internal representation.$(((ab)c)d((e)))$
3 3 votes
3 3 answers
1.6k
1.6k views
A circular linked list is used to represents a queue. A single variable L is used to access the queue. To which node should L point such that both the operation enqueue a...
1 1 vote
1 answers 1 answer
983
983 views
The concatenation of $2$ lists is to be performed in $O(1)$ time. Which of the following implementations should be used?array implementation of listdoubly linked listsing...
3 3 votes
2 answers 2 answers
2.6k
2.6k views
You are given a linked list, L, and another linked list, P, containing integers, sorted in ascending order. The operation print_lots(L,P) will print the elements in L tha...
1 1 vote
1 answers 1 answer
803
803 views
3 3 votes
1 answers 1 answer
2.7k
2.7k views
36 36 votes
3 answers 3 answers
6.3k
6.3k views
A list of $n$ elements is commonly written as a sequence of $n$ elements enclosed in a pair of square brackets. For example. $[10, 20, 30]$ is a list of three elements an...
44 44 votes
5 answers 5 answers
25.4k
25.4k views
In a circular linked list organization, insertion of a record involves modification ofOne pointer.Two pointers.Multiple pointers.No pointer.
0 0 votes
0 0 answers
762
762 views
I am not getting how unsigned is used and how is it working???
0 0 votes
0 0 answers
610
610 views
Let P be a singly linked list. Let Q be the pointer to an intermediate node X in the list. What is the worst case time complexity of the best known algorithm to delete no...
6 6 votes
1 1 answer
3.3k
3.3k views
Consider the following incomplete C function for reversing a singly linked list.node* reverse(node* trav){ if(trav->next) __________________ else { head - next = null; he...