Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged array
2
votes
1
answer
241
Zigzag Arrangement
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For example, suppose the given array is 1 1 2 3 4 5 one possible answer would be 2 1 3 1 5 4. Assumption: Solution do exist for any given input. Hint: Try to avoid sorting.
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For examp...
Arjun
1.7k
views
Arjun
asked
May 27, 2016
Algorithm Challenges
array
combinatory
placement-questions
+
–
4
votes
2
answers
242
Array
The information about an array used in program will be stored in Symbol Table Activation Record Both (A) and (B) Dope Vector
The information about an array used in program will be stored inSymbol TableActivation RecordBoth (A) and (B)Dope Vector
im.raj
5.6k
views
im.raj
asked
May 24, 2016
Programming in C
placement-questions
array
+
–
0
votes
1
answer
243
Algo
Consider an array size of 10 and insertion of 10 element in it.If first five element are inserted at loc =0 and rest five element are at loc=2 then the total number of shifting of elements is: 35 20 45 0
Consider an array size of 10 and insertion of 10 element in it.If first five element are inserted at loc =0 and rest five element are at loc=2then the total number of shi...
ManojK
394
views
ManojK
asked
May 20, 2016
DS
data-structures
array
+
–
0
votes
2
answers
244
Prog \ Predict the output
#include <stdio.h> int main() { char p; char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8}; p = (buf + 1)[5]; printf("%d\n", p); return 0; } (a) 5 (b) 6 (c) 9 (d) none of the above
#include <stdio.h int main() { char p; char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8}; p = (buf + 1)[5]; printf("%d\n", p); return 0; }(a) 5 (b) 6 (c) 9 (d) none of the above
Desert_Warrior
3.0k
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
output
array
+
–
0
votes
1
answer
245
Prog \ What is the output of the following program?
#include <stdio.h> void foo(int[][3]); int main(void) { int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; foo(a); printf("%d\n", a[2][1]); return 0; } void foo(int b[][3]) { ++b; b[1][1] = 9; } (a) 8 (b) 9 (c) 7 (d) none of the above
#include <stdio.h void foo(int[][3]); int main(void) { int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; foo(a); printf("%d\n", a ); return 0; } void foo(int b[][3]) { ...
Desert_Warrior
8.3k
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
array
+
–
0
votes
1
answer
246
Prog \ What is the output of the following program?
#include<stdio.h> #include<stdlib.h> int main() { char s[] = "Opendays2012"; int i = 0; while(*(s++)) i++; printf("%d",i); return 0; } (a) Segmentation Fault (b) Compile Error (c) 12 (d) 0
#include<stdio.h #include<stdlib.h int main() { char s[] = "Opendays2012"; int i = 0; while(*(s++)) i++; printf("%d",i); return 0; }(a) Segmentation Fault (b) Compile Err...
Desert_Warrior
604
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
pointers
output
interview
array
+
–
0
votes
0
answers
247
Programming \ What is the output of the following program?
#include <stdio.h> void foo(int[][3]); int main(void) { int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; foo(a); printf("%d\n", a[2][1]); return 0; } void foo(int b[][3]) { ++b; b[1][1] = 9; } (a) 8 (b) 9 (c) 7 (d) none of the above
#include <stdio.h void foo(int[][3]); int main(void) { int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; foo(a); printf("%d\n", a ); return 0; } void foo(int b[][3]) { ...
Desert_Warrior
600
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
output
interview
array
+
–
0
votes
2
answers
248
Programming \ what is the output?
#include<stdio.h> int main() { int a[10][20][30]={0}; printf("%ld",&a+1 - &a); return 0; }
#include<stdio.h int main() { int a[10][20][30]={0}; printf("%ld",&a+1 - &a); return 0; }
Desert_Warrior
1.6k
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
output
interview
array
+
–
1
votes
1
answer
249
UGC NET CSE | June 2013 | Part 3 | Question: 48
When an array is passed as a parameter to a function which of the following statements is correct? The function can values in the original array The function cannot values in the original array Results in compilation error Results in run-time error
When an array is passed as a parameter to a function which of the following statements is correct?The function can values in the original arrayThe function cannot values ...
im.raj
2.0k
views
im.raj
asked
May 6, 2016
Programming in C
ugcnetcse-june2013-paper3
programming-in-c
array
+
–
9
votes
3
answers
250
ISRO-2013-9
In an array of $2N$ elements that is both 2-ordered and 3-ordered, what is the maximum number of positions that an element can be from its position if the array were 1-ordered? $1$ $2$ $N/2$ $2N - 1$
In an array of $2N$ elements that is both 2-ordered and 3-ordered, what is the maximum number of positions that an element can be from its position if the array were 1-or...
makhdoom ghaya
9.2k
views
makhdoom ghaya
asked
Apr 25, 2016
DS
isro2013
array
+
–
11
votes
2
answers
251
ISRO-2013-1
Let $A(1:8, -5:5, -10:5)$ be a three dimensional array. How many elements are there in the array $A$? $1200$ $1408$ $33$ $1050$
Let $A(1:8, -5:5, -10:5)$ be a three dimensional array. How many elements are there in the array $A$?$1200$$1408$$33$$1050$
makhdoom ghaya
7.9k
views
makhdoom ghaya
asked
Apr 25, 2016
DS
isro2013
array
easy
+
–
35
votes
4
answers
252
GATE CSE 2013 | Question: 51
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $A$. The characters to be replaced are supplied in array $oldc$, while their respective replacement characters are supplied in array $newc$. ... will be successful in exposing the flaw in this procedure? None $2$ only $3$ and $4$ only $4$ only
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $A$. The characters to be replaced are sup...
go_editor
5.3k
views
go_editor
asked
Apr 21, 2016
DS
gatecse-2013
data-structures
array
normal
+
–
1
votes
1
answer
253
Output and please explain
#include<stdio.h> int main() { char *s = "Geeks Quiz"; int n = 7; printf("%.*s", n, s); return 0; }
#include<stdio.h>int main(){char *s = "Geeks Quiz";int n = 7;printf("%.*s", n, s);return 0;}
Sandip Shaw
2.5k
views
Sandip Shaw
asked
Feb 25, 2016
Programming in C
programming-in-c
pointers
array
+
–
0
votes
1
answer
254
What will be the O/P of the following C code? Virtual gate
Purple
1.2k
views
Purple
asked
Jan 31, 2016
Programming in C
algorithms
array
programming-in-c
+
–
0
votes
1
answer
255
merge algo
Number of comparisions in worst case required to merge two sorted arrays of size 40 and 60 are-------
Number of comparisions in worst case required to merge two sorted arrays of size 40 and 60 are -
Kamalkant Patel
285
views
Kamalkant Patel
asked
Jan 30, 2016
Algorithms
algorithms
merging
array
+
–
0
votes
0
answers
256
PDS: Two Dimensional Arrays
Consider the following program: main (){ int i, j; int A[p][q] = { {1, 3, 5}, {2, 4, 6} }; for (i = 0; i < m; i++) for (j = 0; j < n; j++) printf("%d", * (A[j] + i)); } Assume $m$ is number of rows and $n$ is number of columns. Find the OUTPUT printed by the above program. $123456$ $135246$ $456456$ $456789$
Consider the following program:main (){ int i, j; int A[p][q] = { {1, 3, 5}, {2, 4, 6} }; for (i = 0; i < m; i++) for (j = 0; j < n; j++) printf("%d", * (A[j] + i)); }Ass...
Prasanna
716
views
Prasanna
asked
Jan 10, 2016
Programming in C
programming-in-c
array
+
–
0
votes
0
answers
257
Array implementation of matrix
If tthere are two lower triangular matrix A and B.A and transpose B are stored in C. by storing only non zero elements.what should be the dimension of C. And A[i][j]= C[i][j] B[i][j]= C[i][j+1] is also written in notes i dont know its a part of ques. or solution I m not getting it what is actually asked here?
If tthere are two lower triangular matrix A and B.A and transpose B are stored in C. by storing only non zero elements.what should be the dimension of C.And A[i][j]= C[i]...
khushtak
347
views
khushtak
asked
Jan 10, 2016
Programming in C
data-structures
array
+
–
2
votes
1
answer
258
Could any one explain me How to derive formula in RMO CMO ?
There has to be a general method in deriving equations based on RMO and CMO . Could any one explain me how to derive formula of RMO and CMO of important matrices like Upper Triangular Lower Triangular S matrice z matrix Diagonal MAtrix etc
There has to be a general method in deriving equations based on RMO and CMO .Could any one explain me how to derive formula of RMO and CMO of important matrices likeUpper...
pC
998
views
pC
asked
Dec 23, 2015
DS
array
+
–
16
votes
3
answers
259
Find address of element in 3d array
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________.
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________...
shikharV
15.6k
views
shikharV
asked
Dec 4, 2015
DS
data-structures
array
algorithms
+
–
3
votes
2
answers
260
What is ouput will be printed in array , if following code performed
Main () { int a [3] [4] = $\begin{pmatrix} 1&2&3&4 \\ 5&6&7&8 \\ 9&10&11&12 \\ \end{pmatrix}$ printf ("\n% u% u% u", a[0]+1, * (a[0] + 1), *(*(a + 0)+1)); } What is the output of the above program? Assume array begin at address 10.
Main () { int a [3] [4] = $\begin{pmatrix} 1&2&3&4 \\ 5&6&7&8 \\ 9&10&11&12 \\ \end{pmatrix}$ printf ("\n% u% u% u", a[0]+1, * (a[0] + 1), *(*(a + 0)+1)); }What is the o...
sabir
905
views
sabir
asked
Nov 24, 2015
Programming in C
array
pointers
+
–
2
votes
1
answer
261
Finding the address of element in 2D array
Please solve the above problem. Given answer: D
Please solve the above problem. Given answer: D
shikharV
2.4k
views
shikharV
asked
Nov 16, 2015
DS
data-structures
array
+
–
26
votes
5
answers
262
TIFR CSE 2011 | Part B | Question: 30
Consider an array $A[1...n]$. It consists of a permutation of numbers $1....n$. Now compute another array $B[1...n]$ as follows: $B[A[i]]:= i$ for all $i$. Which of the following is true? $B$ will be a sorted array. $B$ ... of array $A$. Doing the same transformation twice will not give the same array. $B$ is not a permutation of array $A$. None of the above.
Consider an array $A[1...n]$. It consists of a permutation of numbers $1....n$. Now compute another array $B[1...n]$ as follows: $B[A[i]]:= i$ for all $i$. Which of the f...
makhdoom ghaya
4.9k
views
makhdoom ghaya
asked
Oct 22, 2015
DS
tifr2011
data-structures
array
+
–
0
votes
1
answer
263
What is K -way merge sort.... !!!!!
What is K -way merge sort.... !!!!! i m very confused....if we say 2-way merge sort..does it mean dividing array into 2 parts or dividing array in size of 2!!!!
What is K -way merge sort.... !!!!! i m very confused....if we say 2-way merge sort..does it mean dividing array into 2 parts or dividing array in size of 2!!!!
pyuri
1.3k
views
pyuri
asked
Oct 6, 2015
Algorithms
merge-sort
array
+
–
8
votes
1
answer
264
ISRO2008-1
Which of the following is an illegal array definition? Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL; var a : array [REAL] of REAL; var a : array [‘A’…’Z’] of REAL; var a : array [BOOLEAN] of REAL;
Which of the following is an illegal array definition?Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL;var a : array [REAL] of REAL;var a : ar...
अनुराग पाण्डेय
9.5k
views
अनुराग पाण्डेय
asked
Oct 4, 2015
Programming in C
isro2008
array
+
–
3
votes
2
answers
265
Cache Memory and Arrays
Given an array A[100] of which each element size is 4 words. Processor uses a Cache Memory which is divided into 4 lines each of size 8 words to execute the following code for(i=0; i<100; ++i) { A[i] = A[i] + 10; } What is ... I needed to extract from this question is : for calculation of hit ratio do we count a write operation as Hit or only Read operations are counted
Given an array A[100] of which each element size is 4 words. Processor uses a Cache Memory which is divided into 4 lines each of size 8 words to execute the following cod...
amarVashishth
2.2k
views
amarVashishth
asked
Jul 8, 2015
CO and Architecture
cache-memory
co-and-architecture
array
+
–
0
votes
3
answers
266
what is the starting address of A[49] ?
A one dimensional array A has indices 1....75.Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The starting address of A[49] is A. 1167 B. 1164 C. 1264 D. ... it takes three memory words.is this correct answer?Does each memory word represents a single character? or am i doing something wrong?
A one dimensional array A has indices 1....75.Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The startin...
GATE_2016
4.0k
views
GATE_2016
asked
Apr 22, 2015
Programming in C
array
programming
+
–
44
votes
3
answers
267
GATE CSE 2015 Set 3 | Question: 30
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $ n \times n$ respectively, where $2 \leq n \leq 10$. Assume that in both code segments, elements of $Y$ are initialized to $0$ ... $2$ are contiguous in main memory Only S2 is correct Only S3 is correct Only S1 and S2 are correct Only S1 and S3 are correct
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $ n \times n$ respectively, where $2 \leq n \leq 10$. Assume th...
go_editor
8.9k
views
go_editor
asked
Feb 15, 2015
Programming in C
gatecse-2015-set3
programming-in-c
normal
array
+
–
48
votes
8
answers
268
GATE CSE 2015 Set 3 | Question: 7
Consider the following C program segment. # include <stdio.h> int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); } What will be printed by the program? $12$ $120400$ $1204$ $1034$
Consider the following C program segment.# include <stdio.h int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); }What will be printed by the pro...
go_editor
16.1k
views
go_editor
asked
Feb 14, 2015
Programming in C
gatecse-2015-set3
programming
programming-in-c
normal
array
+
–
110
votes
6
answers
269
GATE CSE 2015 Set 1 | Question: 35
What is the output of the following C code? Assume that the address of $x$ is $2000$ (in decimal) and an integer requires four bytes of memory. int main () { unsigned int x [4] [3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; printf ("%u, %u, %u", x + 3, *(x + 3), *(x + 2) + 3); } $2036, 2036, 2036$ $2012, 4, 2204$ $2036, 10, 10$ $2012, 4, 6$
What is the output of the following C code? Assume that the address of $x$ is $2000$ (in decimal) and an integer requires four bytes of memory.int main () { unsigned int ...
makhdoom ghaya
28.1k
views
makhdoom ghaya
asked
Feb 13, 2015
Programming in C
gatecse-2015-set1
programming
programming-in-c
array
normal
+
–
72
votes
9
answers
270
GATE CSE 2015 Set 2 | Question: 31
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be any entry to the right of, or below a $\infty$. The following Young tableau ... The minimum number of entries (other than $1$) to be shifted, to remove $1$ from the given Young tableau is _____.
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be...
go_editor
13.2k
views
go_editor
asked
Feb 12, 2015
DS
gatecse-2015-set2
databases
array
normal
numerical-answers
+
–
Page:
« prev
1
...
4
5
6
7
8
9
10
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register