search
Log In

Recent questions in Programming and DS

1 vote
0 answers
1
An external variable is globally accessible by all functions has a declaration “extern” associated with it when declared within a function will be initialized to $0$ if not initialized all of these
asked Apr 2 in Programming Lakshman Patel RJIT 159 views
0 votes
2 answers
2
A hash table with $10$ buckets with one slot per bucket is depicted. The symbols, $S1$ to $S7$ are initially emerged using a hashing function with linear probing. Maximum number of comparisons needed in searching an item that is not present is $6$ $5$ $4$ $3$
asked Apr 2 in DS Lakshman Patel RJIT 156 views
0 votes
1 answer
3
0 votes
1 answer
4
We have a binary heap on $n$ elements and wish to insert $n$ more elements (not necessarily one after another) into this heap. Total time required for this is $\Theta (\log n)$ $\Theta (n)$ $\Theta (n \log n)$ $\Theta (n^{2})$
asked Apr 2 in DS Lakshman Patel RJIT 111 views
0 votes
1 answer
5
You are given the postorder traversal, $P$, of a binary search tree on the $n$ elements $1,2,\dots,n.$ You have to determine the unique binary search tree that has $P$ as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this? $\Theta(\log n)$ $\Theta(n)$ $\Theta(n \log n)$ None of the above, as the tree cannot be uniquely determined.
asked Apr 2 in DS Lakshman Patel RJIT 107 views
0 votes
1 answer
6
Consider the process of inserting an element into a $Max\ Heap$, where the $Max\ Heap$ is represented by an $array$. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of $comparisons$ performed is $\Theta(\log _{2}n)$ $\Theta(n\log _{2} \log_2 n)$ $\Theta (n)$ $\Theta(n\log _{2}n)$
asked Apr 2 in DS Lakshman Patel RJIT 542 views
0 votes
1 answer
7
In a circularly linked list organization, insertion of a record involves the modification of no pointer $1$ pointer $2$ pointers $3$ pointers
asked Apr 2 in DS Lakshman Patel RJIT 131 views
1 vote
1 answer
8
To sort many large objects or structures, it would be most efficient to place them in an array and sort the array pointers to them in an array and sort the array them in a linked list and sort the linked list references to them in an array and sort the array
asked Apr 2 in DS Lakshman Patel RJIT 255 views
2 votes
1 answer
9
The average search time of hashing, with linear probing will be less if the load factor is far less than one equals one is far greater than one none of these
asked Apr 2 in DS Lakshman Patel RJIT 112 views
0 votes
1 answer
10
0 votes
1 answer
11
For $x$ and $y$ are variables as declared below $\textit{double }x=0.005, \: y = – 0.01;$ What is the value of $\text{ceil }(x+y)$, where $\text{ceil }$ is a function to compute ceiling of a number? $1$ $0$ $0.005$ $0.5$
asked Apr 2 in Programming Lakshman Patel RJIT 110 views
0 votes
1 answer
12
In C programming language, if the first and the second operands of operator $+$ are of types int and float, respectively, the result will be of type int float char long int
asked Apr 2 in Programming Lakshman Patel RJIT 92 views
0 votes
1 answer
13
What will be the value of $x$ and $y$ after execution of the following statement(C language) n = 5; x = n++; y = -x; $5,-4$ $6,-5$ $6,-6$ $5,-5$
asked Apr 2 in Programming Lakshman Patel RJIT 83 views
0 votes
1 answer
14
The question is based on the following program fragment. f(intY[10],int x){ int u,j,k; i=0;j=9; do{ k=(i+j)/2; if(Y[k] < x) i=k; else j=k; } while((Y[k]!=x) && (i<j)); if (Y[k]==x) printf( x is in the array. ); else printf( x is not in the array. ); } On which of the following contents of ... $x>2$ $Y$ is $[2\;4\;6\;8\;10\;12\;14\;16\;18\;20]$ and $2<x<20$ and $'x'$ is even
asked Apr 1 in Programming Lakshman Patel RJIT 373 views
0 votes
1 answer
15
What will be the output of following? main() { Static int a = 3; Printf(“%d”,a--); If(a) main(); } $3$ $3\;2\;1$ $3\;3\;3$ Program will fall in continuous loop and print $3$
asked Apr 1 in Programming Lakshman Patel RJIT 222 views
0 votes
1 answer
16
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number number of nodes in a binary tree of height $h$ is $2^{h}$ $2^{h-1} – 1$ $2^{h+1} – 1$ $2^{h+1}$
asked Apr 1 in DS Lakshman Patel RJIT 313 views
0 votes
2 answers
17
0 votes
1 answer
18
If queue is implemented using arrays, what would be the worst run time complexity of queue and dequeue operations? $O(n),O(n)$ $O(n),O(1)$ $O(1),O(n)$ $O(1),O(1)$
asked Apr 1 in DS Lakshman Patel RJIT 172 views
0 votes
1 answer
19
The following program fragment prints int i = 5; do { putchar(i+100); printf(“%d”, i--;) } while(i); i5h4g3f2el 14h3g2f1e0 An error message None of the above
asked Apr 1 in Programming Lakshman Patel RJIT 137 views
...