search
Log In

Questions without answers in Programming and DS

2 votes
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, 2020 in Programming Lakshman Patel RJIT 233 views
0 votes
0 answers
2
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, 2020 in Programming Lakshman Patel RJIT 174 views
0 votes
0 answers
3
If space occupied by two strings $s_1$ and $s_2$ in 'C' are respectively $m$ and $n$, then space occupied by string obtained by concatenating $s_1$ and $s_2$ is always less than $m+n$ equal to $m+n$ greater than $m+n$ none of these
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 240 views
1 vote
0 answers
4
A function object : is an instance of a class for which operator ( ) is a member function is an instance of a class for which operator → is a member function is a pointer to any function is a member function of a class
asked Mar 26, 2020 in Programming jothee 50 views
0 votes
0 answers
5
What item is at the root after the following sequence of insertions into an empty splay tree : $1, 11, 3, 10, 8, 4, 6, 5, 7, 9, 2, ?$ $1$ $2$ $4$ $8$
asked Mar 26, 2020 in DS jothee 78 views
1 vote
0 answers
6
We know that UNIX support a feature that allows for variable field with precision. please help me out in this statement -> printf(“% * .* s \n”,w,d,string); ? i know using of precision with string such as %10.4s <width>.<precision> indicating that first four character to be printed in a field with 10 columns.
asked Jun 6, 2019 in Programming Aks9639 182 views
1 vote
0 answers
7
$1)$How circular queue can be implemented? $2)$ For which data structure circular queue cannot be implemented? $(A)$Array $(B)$ Singly Linked List $(C)$ Doubly Linked List $(D)$ Stack
asked May 24, 2019 in DS srestha 423 views
0 votes
0 answers
8
why we use double pointer struct Node** head here? can anyone explain with details /* Given a reference (pointer to pointer) to the head of a DLL and an int, appends a new node at the end */ void append(struct Node** head_ref, int new_data) { struct Node* new_node = ( ... new_node; return; } while (last->next != NULL) last = last->next; last->next = new_node; new_node->prev = last; return; }
asked May 24, 2019 in DS Arun Rout 238 views
0 votes
0 answers
9
A stack based CPU executes the instruction. Memory location $500$ contain $0X 88$ and memory location $700$ contain $0X37$. The stack pointer is at $0X003F$ The instruction are as follows: $I_{1}:PUSH$ $500$ $I_{2}:PUSH$. $700$ $I_{3}:ADD$ $I_{4}:POP$ ... $0X88$ after execution of instruction. $C)$ Memory location $600$ contain $0XBF$ after execution of instruction. $D)$ Both $a)$ and $c)$
asked May 22, 2019 in DS srestha 293 views
1 vote
0 answers
10
Consider the following C code: int getNextGap(int gap){ gap=(gap*10)/13; if(gap<1)return 1; return gap; } void mystery(int a[ ],int n){ int gap=n; bool red=true; while(gap!=1||red==true){ gap=getNextGap(gap); red=false; for(int i=0;i<(n-gap ... n is number of array elements, then what output will print at last? I mostly stuck how bool function working here. Plz help me out, how program executing:(
asked May 10, 2019 in Programming srestha 336 views
1 vote
0 answers
11
Consider the following function int fun(int a[ ],int l, int target){ int i=0,j=0,sum=0,count=0; while(j<l){ if(sum<target){ sum=sum+a[j]; j++; } else if(sum>target){ sum=sum-a[i]; i++; } else{ count++; sum=sum-a[i]; i++; } } if(sum==target) ... be return value of function call $fun\left ( a,16,8 \right )=$_______________ Given ans $6,$ but I got $4.$ Which one correct?? Any shortcut to evaluate??
asked May 8, 2019 in Programming srestha 358 views
1 vote
0 answers
12
Consider the following program: void A(int n){ printf("*"); if(n>1){ A(n/4); A(n/4); A(n/4); A(n/4); } } Let $X$ be number of asterisks printed by above function when $n=1024.$ Then the value of $X$ will be ____________ How ans will be $\frac{4^{k+1}-1}{3}$ , where $k=5?$ .
asked May 4, 2019 in Programming srestha 348 views
2 votes
0 answers
13
Consider the integer array $A\left [ 1.........100,1.......100 \right ]$ in which the elements are stored in $Z$ representation. An example of a $5\times 5$ array in $Z$ representation is shown below: If the base address of $A$ is starting from $1000$ ... $A$ is stored in Row Major Order, then the address corresponding to $A\left [ 100 \right ]\left [ 55 \right ]$ is ________________
asked May 4, 2019 in Programming srestha 167 views
0 votes
0 answers
14
Can we assign a value to a variable in calling a function as function argument? Ex- Int Func c( int); Int i =3; Void main(){ Fun c ( i=3)} Int Func c (int x) { Int x++; return x; } Please pardon me as the code above is not accurate but can give an idea of what i am trying to ask.
asked Apr 29, 2019 in Programming ranarajesh495 170 views
0 votes
0 answers
15
Obtain the indexing formula for lower-right and upper-left triangular matrices using row-major order and column-major order. Consider the cases of : square matrix of order n x n. non-square matrix of order m x n, m ≠ n. I need a solution with explanation thanks in advance.
asked Apr 18, 2019 in DS mahi.0409 309 views
0 votes
0 answers
16
I'm learning data structures from a book. In the topic, Circular Queue using Dynamic Array, the author has mentioned below point, Let capacity be the initial capacity of the circular queue,We must first increase the size of the array using realloc,this will copy maximum ... copies at most capacity elements. But how does array doubling and slide to right copy at most 2 * capacity -2 elements??
asked Apr 14, 2019 in DS Durga Teja 740 views
–1 vote
0 answers
17
void fun(int,int*); int main() { int=-5,j=-2; fun(i,&j); print f(“i=%d j=%d\n”,i,j); return 0; } void fun(int i,int *j) { i=i*i; *j=*j * *j; }
asked Apr 12, 2019 in Programming altamash 120 views
–2 votes
0 answers
18
plzzz explain how this code is executed
asked Apr 8, 2019 in Programming saket nandan 140 views
0 votes
0 answers
19
Can somebody explain this code line by line. I am unable to get and what will be it's output? #include<stdio.h> #include<stdlib.h> void transpose(int n, const double *A, double *B, const int *lda, int *perm) { } int transpose_equal(const double *A, const double*B, int total_size ... (ndim, B_trans, B, r_dim, r_perm); transpose_equal(A, B, total); free(A); free(B); free(B_trans); printf("\n"); } }
asked Apr 3, 2019 in Programming srestha 138 views
0 votes
0 answers
20
FOR THE EXTENDED-SHORTEST-PATH if we want to find the distance between 1->4 and the 1->5 +5->4 gives the shortest path and if 1->5 gets its shortest path as 1->2->5 and 5>4 gets its shortest path as 5->3->4 then how will we get it?? as one of the operands is always from the initial array.
asked Mar 30, 2019 in Programming Doraemon 68 views
0 votes
0 answers
21
A directed acyclic graph has no connected components. TRUE OR FALSE???
asked Mar 30, 2019 in Programming Doraemon 59 views
0 votes
0 answers
22
For multiplication method in hashing the formula is h(k)=m* (KA mod 1); m=2^p, k=key , 0<A<1 My question is how does it actually works. Please explain in a detailed way.
asked Mar 29, 2019 in Programming Doraemon 60 views
0 votes
0 answers
23
Do something (x, n) { m = n, temp = 1, z = x ; while (m > 0) do { while ((m mod z) == 0) do { m = |m/2|; z = z^{2} ; } m = m – 1; } return temp ; } Complexity of the above problem $1)\Theta \left ( log n \right )$ $2)\Theta \left ( nlog n \right )$ $3)\Theta \left (n^{2} \right )$ $4)\Theta \left (n\right )$
asked Mar 28, 2019 in Programming srestha 159 views
0 votes
0 answers
24
#include <stdio.h> // Note that arr[] for fun is just a pointer even if square // brackets are used void fun(char arr[]) // SAME AS void fun(int *arr) { unsigned int n = sizeof(arr)/sizeof(arr[0]); printf("\nArray size inside fun() is %d", n); } // Driver ... ***************** output is confusing : need explaination how is it happening Array size inside main() is 6 Array size inside fun() is 8
asked Mar 23, 2019 in Programming hitendra singh 198 views
1 vote
0 answers
25
In the above 4 Statements which would print 123 as output ? Explain also.
asked Mar 16, 2019 in Programming Ashish Roy 1 353 views
1 vote
0 answers
26
void find(int x){ static int i=10,y=0; y=y+i; for(i;i>0;i=i-10){ if(x!=0) find(x-1); else{ printf("%d",y); } } } What will be output printed for find(4)?
asked Mar 6, 2019 in Programming srestha 236 views
0 votes
0 answers
27
#include <stdio.h> int main(void) { char s1[15]="SREE"; char s2[10]="ALL THE BEST"; strcpy(s2,s1); printf("\n%s",s2); return 0; } 1)How s2 will contain a string of size 12, while it only contain size 10? 2)Why strcpy will not merge the rest string of s2 with s1 after copying , I mean “SREETHE BEST” Will it work like pointer that s2 pointing to same as s1? Anything link good to read about strcpy
asked Mar 5, 2019 in Programming srestha 157 views
2 votes
0 answers
28
What will be output of the program? int d=0; int f(int a,int b){ int c; d++; if(b==3) return a*a*a; else{ c=f(a,b/3); return(c*c*c); } } int main(){ printf("%d",f(4,81)); return 0; }
asked Mar 5, 2019 in Programming srestha 382 views
1 vote
0 answers
29
An OS uses virtual memory with paging technique for memory allocation. Which of the following searching technique on given data structure use locality of reference? Linear search on linked list Binary search on array Linear search on array Binary search on linked list
asked Mar 2, 2019 in Programming srestha 400 views
0 votes
0 answers
30
If inorder traversing a tree results in E A C K F H D B G, the preorder traversal would return (a) FAEKCDBHG (b) FAEKCDHGB (c) EAFKHDCBG (d) FEAKDCHBG
asked Feb 24, 2019 in DS 8676rau 889 views
To see more, click for the full list of questions or popular tags.
...