Recent questions tagged array

1 1 vote
1 answers 1 answer
718
718 views
How is the address written for 3-dimensional arrays?In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow??Also, how ...
2 2 votes
1 1 answer
1.4k
1.4k views
You are given an array of elements where each array element represents the MAXIMUM number of jumps that can be made in the forward direction from that element. Now, consi...
2 2 votes
1 1 answer
2.7k
2.7k views
# include <stdio.h void print(int arr[]){ int n = sizeof(arr)/sizeof(arr[0]); int i; for (i = 0; i < n; i++) printf("%d ", arr[i]);} int main(){ int arr[] = ...
0 0 votes
1 1 answer
887
887 views
What is the output of following code?main () struct s1 { char * z; int i; struct s1 * p; } static struct s 1 a []}={ {"Nagpur", 1, a+1} {"Raipur', 2, a+2} {"Kanpur', 3, a...
0 0 votes
1 1 answer
1.0k
1.0k views
Consider the following statements about heap sort algorithm:The MAX-HEAPIFY procedure which runs in $\mathrm{O} \lg (n)$ time, is the key to maintaining the max heap prop...
1 1 vote
1 1 answer
657
657 views
A three dimensional array in $\mathrm{C}++$ is declared as int $\mathrm{A}[\mathrm{a}][\mathrm{b}]$ [c]. Consider that array elements are stored in row major order and in...
0 0 votes
0 0 answers
472
472 views
What is $\mathrm{x}$ in the following program?# include < stdioh int main ( ) {typedef (*(* arrfptr[3])())[10]; arrfptr x ; return 0 ; } $x$ is a pointer$x$ is a array o...
0 0 votes
1 1 answer
421
421 views
What is the output of following code?main () { static float a[]=\{13.24,1.5,4.5,5.4,3.5} float * j, * k; j= a}; k= a + 4 j=j * 2; k = k / 2; printf ("% f % f",* j,*k); } ...
0 0 votes
0 0 answers
408
408 views
Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to sc...
0 0 votes
0 0 answers
371
371 views
Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to sc...
0 0 votes
0 0 answers
333
333 views
Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to sc...
2 2 votes
1 1 answer
862
862 views
Can an array store elements of different storage classes?
1 1 vote
1 answers 1 answer
994
994 views
Q. 4 Consider the 2 dimensional array. A $[-8 \ldots 12$, $-4 \ldots 16]$. Calculate the address of $A[1,3]$. Assume that it is stored in a row major order. Each element ...
5 5 votes
3 3 answers
1.8k
1.8k views
In QuickSort algorithm, which of the following statements is NOT true regarding the partition process?a) Partition always divides the array into two non-empty subsets.b) ...
0 0 votes
1 1 answer
825
825 views
We have stored an element after a few elements in an array, where the array size is unknown, then find the position of in array.
1 1 vote
1 1 answer
1.1k
1.1k views
What is the worst case time complexity of an efficient algorithm (in order of n) to get the last index for an actually filled element, in an array, given the condition th...
0 0 votes
1 1 answer
902
902 views
What is the logic applied here.Q. 32Have any Doubt?You are given an array of elements where each array element represents the MAXIMUM number of jumps that can be made in ...
1 1 vote
2 2 answers
939
939 views
The return value of ace(4) is int ace(int a) { int x=1; static int k=1; if(a==1) return x; for(;k<a;++k) x=x+ace(k)*ace(a-k); return x; }A.15B.4C.10D.Error