search
Log In

Recent questions tagged linked-lists

2 votes
1 answer
1
If the queue is implemented with a linked list, keeping track of a front pointer, which of these pointers will change during an insertion into an non-empty queue? Neither of the pointer change Only front pointer changes Only rear pointer changes Both of the pointer changes
asked Jul 25, 2016 in Programming jothee 1.5k views
3 votes
2 answers
2
Given a linked list : 1->2->3->4->5->6, make the following changes 1->6->2->5->3->4 What would be the most effiicient way to make this change?
asked Jul 22, 2016 in Algorithm Challenges sh!va 1k views
1 vote
2 answers
3
The efficient data structure to insert/delete a number in a stored set of number is Queue Linked list Doubly linked list Binary tree
asked Jul 20, 2016 in DS jothee 1.6k views
3 votes
6 answers
4
Consider a single linked list where $F$ and $L$ are pointers to the first and last elements respectively of the linked list. The time for performing which of the given operations depends on the length of the linked list? Delete the first element of the list Interchange the first two elements of the list Delete the last element of the list Add an element at the end of the list
asked Jul 1, 2016 in DS jothee 5.2k views
5 votes
2 answers
5
Can Someone explain either Tree or Stack method to trace out this recursion ? What is the output of this Program ?
asked Jun 28, 2016 in Programming shekhar chauhan 455 views
4 votes
1 answer
6
Linked Lists are not suitable for _____. A. Binary Search B. Polynomial Manipulation C. Insertion D. Radix Sort
asked Jun 16, 2016 in DS im.raj 4.5k views
5 votes
3 answers
7
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list? Deleting a node whose location is given Searching an unsorted list for a given item Inserting a node after the node with a given location Traversing the list to process each node
asked Jun 13, 2016 in DS jothee 4.9k views
1 vote
1 answer
8
The time required to search an element in a linked list of length n is $O(\log_2 n)$ $O(n)$ $O(1)$ $O(n^2)$
asked Jun 13, 2016 in DS jothee 3.5k views
14 votes
1 answer
9
Consider a linked list containing $n$ nodes, where each node contains two pointers $ptr1$ and $ptr2$. For each node, $ptr1$ points to the next node of the list. Describe how pointer $ptr2$ should be set up for each node so that you will be able to locate the $i$-th node from the start node in the list traversing no more than $[\log\: i] + [i/2]$ nodes.
asked May 29, 2016 in DS jothee 997 views
8 votes
1 answer
10
We use the notation $[x1,x2,...,xn]$ to denote a list of integers. $[]$ denotes the empty list, and $[n]$ is the list consisting of one integer $n$. For a nonempty list l, $head(l)$ returns the first element of $l$, and $tail(l)$ returns the list obtained by ... head(tail(l)) then return g(tail(l)) else return(false) When does $f(l)$ return the value true for an input $l$? Explain your answer.
asked May 23, 2016 in DS jothee 482 views
2 votes
0 answers
11
A finite sequence of bits is represented as a list with values from the set $\{0,1\}$-for example, $[0,1,0], [1,0,1,1], \dots [ \: ]$ denotes the empty list, and $[b]$ is the list consisting of one bit $b$. For a nonempty list $l, \text{ head}(l)$ ... bit. g2(n) if (n == 0) then return(0) else return f2(g2(n-1),g1(n)) endif What is the value of $g2(7)$ and $g2(8)$?
asked May 20, 2016 in DS jothee 141 views
1 vote
0 answers
12
A finite sequence of bits is represented as a list with values from the set {0,1}—for example, [0,1,0], [1,0,1,1], . . . . [ ] denotes the empty list, and [b] is the list consisting of one bit b. The function $length(l)$ returns the length (number of bits) in the ... (s,tail(t)),mystery2(s,tail(t)))) endif What is the value of $length(mystery2(s,t))$ in terms of $length(s)$ and $length(t)$?
asked May 19, 2016 in DS jothee 189 views
6 votes
2 answers
13
The following steps in a linked list p = getnode() info(p) = 10 next (p) = list list = p result in which type of operation? Pop operation in stack Removal of a node Inserting a node Modifying an existing node
asked Apr 25, 2016 in DS makhdoom ghaya 3.5k views
0 votes
4 answers
14
If we are given a linked list then we have to manipulate such that even indexed node are arranged together and odd indexed nodes are arranged together after even indexed nodes for instance the given linked list is 1-->2-->3-->4-->5-->6 , so the op should be 2-->4-->6-->1-->3-->5
asked Apr 7, 2016 in Algorithms radha gogia 397 views
56 votes
6 answers
15
$N$ items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this ... operations put together? $O(\log^{2} N)$ $O(N)$ $O(N^{2})$ $\Theta\left(N^{2}\log N\right)$
asked Feb 12, 2016 in DS Akash Kanase 14.8k views
2 votes
2 answers
16
asked Jan 31, 2016 in Programming Sourabh Kumar 1.8k views
0 votes
1 answer
17
1 vote
0 answers
18
A program has just read the $12^{th}$ disk block using linked allocation. If it next want to read the $5^{th}$ disk block, then the number of disk blocks must the program already read to reach the $5^{th}$ disk block ________.
asked Jan 22, 2016 in Operating System Sourabh Kumar 155 views
0 votes
1 answer
19
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); } will it print 5-4-3-2-1 or 4-3-2-1 if i/p is 1-2-3-4-5?Will the last 5 get printed or not , due to return;
asked Jan 21, 2016 in Programming chat28 1.8k views
0 votes
1 answer
20
My doubt is that the single list queue is the form : 1->2->3->4->5->6->7->8->9->NULL with 1 as the rear node and 9 as the front node. Also, in a queue, addition takes from the rear and the deletion from the front, so a structure like above should ... item O(1) time, right? I just want to confirm whether my answer was right or the answer given. Source : testbook.com live test on 3rd January, 2016
asked Jan 4, 2016 in DS Utk 291 views
0 votes
2 answers
21
2 votes
3 answers
22
asked Dec 27, 2015 in DS nitish 439 views
1 vote
1 answer
23
In circular linked list, insertion of a node at the end involves pointer modification: (A) one (B) two (C) three (D) none
asked Nov 15, 2015 in DS shikharV 295 views
2 votes
5 answers
24
The minimum number of fields with each node of doubly linked list is 1 2 3 4
asked Sep 20, 2015 in DS ajit 2.8k views
0 votes
2 answers
25
18 votes
2 answers
26
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure. The function is called with the list containing the integers $1, 2, 3, 4, 5, 6, 7$ in the given order. What will be the contents of the list after the ... $2, 1, 4, 3, 6, 5, 7$ $1, 3, 2, 5, 4, 7, 6$ $2, 3, 4, 5, 6, 7, 1$
asked Nov 4, 2014 in DS Ishrat Jahan 2.4k views
39 votes
9 answers
27
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 the node $x$ from the list ? $O(n)$ $O(\log^2 n)$ $O(\log n)$ $O(1)$
asked Nov 2, 2014 in DS Ishrat Jahan 7.7k views
24 votes
3 answers
28
Consider the following statements: First-in-first out types of computations are efficiently supported by STACKS. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations. Implementing QUEUES on a circular array is more efficient than implementing ... $(ii)$ are true $(iii)$ and $(iv)$ are true $(ii)$ and $(iv)$ are true
asked Oct 9, 2014 in DS Kathleen 4.9k views
15 votes
3 answers
29
Which of the following statements is true? As the number of entries in a hash table increases, the number of collisions increases. Recursive programs are efficient The worst case complexity for Quicksort is $O(n^2)$ Binary search using a linear linked list is efficient I and II II and III I and IV I and III
asked Oct 8, 2014 in DS Kathleen 3.4k views
20 votes
3 answers
30
Linked lists are not suitable data structures for which one of the following problems? Insertion sort Binary search Radix sort Polynomial manipulation
asked Oct 4, 2014 in DS Kathleen 6.3k views
...