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
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?
1 vote
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
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
5
Can Someone explain either Tree or Stack method to trace out this recursion ? What is the output of this Program ?
6
Linked Lists are not suitable for _____. A. Binary Search B. Polynomial Manipulation C. Insertion D. Radix Sort
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
1 vote
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)$
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.
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.
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)$?
1 vote
12
A finite sequence of bits is represented as a list with values from the set {0,1}&mdash;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)$?
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
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
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)$
16
17
Here, what will be the Head->Next , I am confused is it first element 50 or second element 29.
1 vote
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 ________.
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;
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
21
Delete the duplicate node Delete the alternate duplicate node Delete the adjacent node None of these
22
1 vote
23
In circular linked list, insertion of a node at the end involves pointer modification: (A) one (B) two (C) three (D) none
24
The minimum number of fields with each node of doubly linked list is 1 2 3 4
25
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$
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)$
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
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