Recent questions tagged array

6 votes
5 answers
95
What is the output of the code given below?# include<stdio.h int main() { char name[]="satellites"; int len; int size; len= strlen(name); size = sizeof(name); printf("%d"...
1 votes
1 answer
96
Given an array of ( both positive and negative ) integers, $a_0,a_1,….a_{n-1}$ and $l, 1<l<n$.Design a linear time algorithm to compute the maximum product subarray, wh...
2 votes
1 answer
97
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i.Ans should be O(log n) right by do...
0 votes
1 answer
99
How to improve cache hit rate in case of transfer of element from 2-D array to matrix.? (Consider the column major order in 2D array)
0 votes
0 answers
100
Can someone please provide a link to an article or a video explaining cache and arrays concept. Im having a hard time understanding that concept.
1 votes
0 answers
101
0 votes
1 answer
102
A Sorted array of n elements contains 0 and 1 to find out majority of 0 and 1.How much time it will take???and please explain Meaning -majority of 0 and 1??
1 votes
2 answers
103
Tell me the difference :&(arr+1) and &arr+1
14 votes
6 answers
104
1 votes
1 answer
105
Main memory=512 words.block size=8 words.cache size =32 wordsThere is an array A[100] and each element is 4 words then what is the hit ratio for the following loop.for...
0 votes
1 answer
108
Match all items in $\text{Group 1}$ with the $\textbf{best}$ match from the options given in $\text{Group 2}.$$$\begin{array}{|l|l|} \hline \qquad \quad \textbf{Group 1} ...
5 votes
1 answer
109
someone please explain this:how does a+1 differs from &a+1 in above code?detailed explanation would be of great help as they incremented &a by 6 and NOT 1
0 votes
0 answers
112
Consider an array A[100] and each element occupies 4 word a 32-word cache is used and divided into an 8-word blockWhat is the hit ratio for for(i=0;i<100;i++...
0 votes
1 answer
114
if array declared size is larger than values initialised. Then what value rest memory elements have , 0 or garbage?
1 votes
2 answers
116
Given a 2D array A[40….95, 40...95] in lower triangular representation, size of each element is 1 ByteArray implemented in row major order, base address is 1000Address ...
0 votes
0 answers
119
Better than O(n) exists ?
0 votes
1 answer
120
Given an Unsorted array, Find maximum in less than O(n) time?How can we do this?