Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged array
6
votes
3
answers
211
doubt
Please explain how to solve this.
Please explain how to solve this.
Arnabi
530
views
Arnabi
asked
Dec 13, 2016
DS
array
+
–
3
votes
3
answers
212
Address of Element in Array
I am not getting the answer , (11*8*13+67)*4+ base address =400+4844= 5244. But the answer is 5336, please explain. similar question is here: https://gateoverflow.in/29361/find-address-of-element-in-3d-array
I am not getting the answer , (11*8*13+67)*4+ base address =400+4844= 5244.But the answer is 5336, please explain.similar question is here: https://gateoverflow.in/29361/...
vishwa ratna
2.6k
views
vishwa ratna
asked
Dec 12, 2016
Programming in C
data-structures
array
+
–
3
votes
1
answer
213
C-Programming 3D Array
KISHALAY DAS
1.4k
views
KISHALAY DAS
asked
Dec 11, 2016
Programming in C
array
programming-in-c
+
–
0
votes
2
answers
214
Pointers and arrays
#include <stdio.h> int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr)[1], (*ptr)[2]); ++ptr; printf("%d %d\n", (*ptr)[1], (*ptr)[2]); return 0; } (a) 2 3 5 6 (b) 2 3 4 5 (c) 4 5 0 0 (d) none of the above
#include <stdio.h int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr) , (*ptr) ); ++ptr; printf("%d %d\n", (*ptr) , (*ptr) ); return ...
vishalmessi
4.0k
views
vishalmessi
asked
Dec 11, 2016
Programming in C
programming
pointers
array-of-pointers
array
+
–
0
votes
0
answers
215
dout plz correct me
Vishal Goyal
282
views
Vishal Goyal
asked
Dec 6, 2016
DS
test-series
array
data-structures
+
–
0
votes
3
answers
216
Binary tree Made-easy-test-series
The minimum size that an array may require to store a binary tree with n nodes $2^{\left \lceil(log_2(n+1)) \right \rceil -1}$ $2n-1$ $2n-n+1$ $n+1$
The minimum size that an array may require to store a binary tree with n nodes$2^{\left \lceil(log_2(n+1)) \right \rceil -1}$$2n-1$$2n-n+1$$n+1$
thor
4.2k
views
thor
asked
Nov 27, 2016
DS
binary-tree
array
made-easy-test-series
+
–
2
votes
1
answer
217
data structure
if the toeplitz matrix of order (5*5) is stored in one dimentional array then optimum number of elements stored will be?
if the toeplitz matrix of order (5*5) is stored in one dimentional array then optimum number of elements stored will be?
Hetal Chourasia
1.1k
views
Hetal Chourasia
asked
Nov 22, 2016
Programming in C
array
data-structures
+
–
0
votes
1
answer
218
Cache and arrays
Consider below code written in C Loop A sum = 0; for (i = 0; i < 128; i++) for (j = 0; j < 64; j++) sum += A[i][j]; Loop B sum = 0; for (j = 0; j < 64; j++) for (i = 0; i < 128; i++) sum += A[i][j]; The matrix A ... entries are word addressable, what bits of the 32 bit physical address comprise the tag, index and offset? i)(19,8,8) ii)(20,8,7) iii)(17,8,7) iv)(18,8,6)
Consider below code written in C Loop Asum = 0; for (i = 0; i < 128; i++) for (j = 0; j < 64; j++) sum += A[i][j]; Loop Bsum = 0; for (j = 0; ...
Arnabi
614
views
Arnabi
asked
Nov 15, 2016
CO and Architecture
cache-memory
and
array
co-and-architecture
+
–
0
votes
1
answer
219
Arrays and cache
Consider below code written in C Loop A sum = 0; for (i = 0; i < 128; i++) for (j = 0; j < 64; j++) sum += A[i][j]; Loop B sum = 0; for (j = 0; j < 64; j++) for (i = 0; i < 128; i++) sum + ... cache with 8-word (32-byte) cache lines. Calculate the number of cache misses that will occur when running Loop A. i)1392 misses ii) 1024 misses iii)1020 misses iv)1323 misses
Consider below code written in C Loop Asum = 0; for (i = 0; i < 128; i++) for (j = 0; j < 64; j++) sum += A[i][j]; Loop Bsum = 0; for (j = 0; ...
Arnabi
598
views
Arnabi
asked
Nov 15, 2016
CO and Architecture
array
and
cache-memory
co-and-architecture
+
–
0
votes
1
answer
220
ARRAY
Consider an array contains n integers, each integer belongs to {-1, 0, 1}. What is the best case time complexity to sort an array?
Consider an array contains n integers, each integer belongs to {-1, 0, 1}. What is the best case time complexity to sort an array?
Rohan Mundhey
480
views
Rohan Mundhey
asked
Nov 9, 2016
Algorithms
sorting
time-complexity
array
+
–
1
votes
3
answers
221
Ace Questions
Answer is 407 , how? Please dont just throw away formula, explain it.
Answer is 407 , how? Please dont just throw away formula, explain it.
vishwa ratna
6.6k
views
vishwa ratna
asked
Nov 8, 2016
Programming in C
array
+
–
4
votes
2
answers
222
ME book
a[-25.....+25, -25......+25], Base address=0 and size of element = 100 bytes Find the location of a[20][22] ? Also Matrix is upper triangular matrix with row major order
a[-25.....+25, -25......+25], Base address=0 and size of element = 100 bytesFind the location of a[20][22] ?Also Matrix is upper triangular matrix with row major order
Digvijaysingh Gautam
1.7k
views
Digvijaysingh Gautam
asked
Oct 19, 2016
Programming in C
array
+
–
0
votes
1
answer
223
find
A one dimensional array A has indices 1...75.Each element is a string and takes three memory words .The array is stored at location 1120 decimal .The starting address of A[49] is a)1267 b)1134 c)1264 d)1169
A one dimensional array A has indices 1...75.Each element is a string and takes three memory words .The array is stored at location 1120 decimal .The starting address of ...
neha singh
439
views
neha singh
asked
Oct 11, 2016
Algorithms
data-structures
array
+
–
1
votes
2
answers
224
GATE Overflow | Data Structures | Test 1 | Question: 29
Which of the following is false? Arrays are better than linked lists for sorting due to better data locality. Asymptotic time complxity for FindMax is same on an unsorted array as that on a singly linked list. A doubly linked list ... as of a singly linked list. Given a fixed maximum size, a circular queue is preferrable to a normal queue
Which of the following is false?Arrays are better than linked lists for sorting due to better data locality.Asymptotic time complxity for FindMax is same on an unsorted a...
Arjun
820
views
Arjun
asked
Oct 10, 2016
DS
go-ds-1
data-structures
array
queue
+
–
0
votes
2
answers
225
GATE Overflow | Data Structures | Test 1 | Question: 23
Consider the following declaration of a two dimensional array in C: char a[1000][40]; Assuming that the main memory is byte addressable and that the array is stored starting from address 0, the address of a[40][10] is _____
Consider the following declaration of a two dimensional array in C:char a[1000][40];Assuming that the main memory is byte addressable and that the array is stored startin...
Arjun
520
views
Arjun
asked
Oct 10, 2016
DS
go-ds-1
data-structures
programming-in-c
array
numerical-answers
+
–
4
votes
2
answers
226
GATE Overflow | Data Structures | Test 1 | Question: 17
In a class examination marks was out of 100 and there were only 1 or 2 mark questions with total 70 questions and pass mark being 36. In order to find the most repeating total mark among passed students, the appropriate data ... An array of 100 numbers An array of 70 numbers An array of 65 numbers A dynamically allocated array of 100 numbers
In a class examination marks was out of 100 and there were only 1 or 2 mark questions with total 70 questions and pass mark being 36. In order to find the most repeating ...
Arjun
501
views
Arjun
asked
Oct 10, 2016
DS
go-ds-1
data-structures
array
+
–
4
votes
1
answer
227
Programming
Rahul Jain25
692
views
Rahul Jain25
asked
Oct 7, 2016
Programming in C
programming-in-c
array
+
–
0
votes
2
answers
228
practice question
Let A be an array containing ndistinct integers in unsorted order. The following algorithm [code] run on unordered array A. Random_call (A) For i = n to 1 max = i for j = i - 1 to 1 If A[ j ] < A [max] max = j temp = A ... unsorted array in nondecreasing order. b. Sort unsorted array in nonincreasing order c. Reverse the order of elements of the array. d. None of the above.
Let A be an array containing ndistinct integers in unsorted order. The following algorithm [code] run on unordered array A.Random_call (A)For i = n to 1max = ifor j = i...
Tariq Husain Khan
391
views
Tariq Husain Khan
asked
Sep 9, 2016
Algorithms
algorithms
sorting
array
output
+
–
3
votes
3
answers
229
UGC NET CSE | June 2016 | Part 3 | Question: 32
Let $A[1,...,n]$ be an array of n distinct numbers. If $i<j$ and $A[i]>A[j]$, then the pair $(i,j)$ is called an inversion of $A$. What is the expected number of inversions in any permutation on $n$ elements? $\theta(n)$ $\theta(lgn)$ $\theta(nlgn)$ $\theta(n^2)$
Let $A[1,...,n]$ be an array of n distinct numbers. If $i<j$ and $A[i]>A[j]$, then the pair $(i,j)$ is called an inversion of $A$. What is the expected number of inversio...
go_editor
5.7k
views
go_editor
asked
Aug 20, 2016
Algorithms
ugcnetcse-june2016-paper3
algorithms
array
+
–
1
votes
3
answers
230
UGC NET CSE | Junet 2015 | Part 2 | Question: 11
What is the output of the following program: (Assume that the appropriate preprocessor directives are included and there is not syntax error) main( ) { char S[]="ABCDEFGH"; printf("%C", *(&S[3])); printf("%s", S+4 ... of S is 1000 */ } $\text{ABCDEFGH}1000$ $\text{CDEFGH}1000$ $\text{DDEFGHH}1000$ $\text{DEFGH}1000$
What is the output of the following program: (Assume that the appropriate preprocessor directives are included and there is not syntax error)main( ) { char S[]="ABCDEFGH"...
go_editor
2.4k
views
go_editor
asked
Jul 30, 2016
Programming in C
ugcnetcse-june2015-paper2
programming-in-c
array
+
–
1
votes
1
answer
231
Array
Sourabh Kumar
356
views
Sourabh Kumar
asked
Jul 25, 2016
Programming in C
array
array-of-pointers
+
–
2
votes
1
answer
232
Interview Question: Modify array with max performance
Given an array of integers, update the index with multiplication of previous and next integers, e.g. Input: 2 , 3, 4, 5, 6 Output: 2*3, 2*4, 3*5, 4*6, 5*6 Please suggest an approach that gives output with maximum performance:
Given an array of integers, update the index with multiplication of previous and next integers, e.g.Input: 2 , 3, 4, 5, 6Output: 2*3, 2*4, 3*5, 4*6, 5*6 Please suggest ...
sh!va
436
views
sh!va
asked
Jul 23, 2016
Programming in C
interview
array
+
–
3
votes
3
answers
233
UGC NET CSE | December 2014 | Part 2 | Question: 24
Consider an array $A\left[20, 10\right]$, assume $4$ words per memory cell and the base address of array $A$ is $100$. What is the address of $A\left[11, 5\right]$ ? Assume row major storage. $560$ $565$ $570$ $575$
Consider an array $A\left[20, 10\right]$, assume $4$ words per memory cell and the base address of array $A$ is $100$. What is the address of $A\left[11, 5\right]$ ? Assu...
makhdoom ghaya
19.5k
views
makhdoom ghaya
asked
Jul 21, 2016
Programming in C
ugcnetcse-dec2014-paper2
array
row-major-address-calculation
+
–
3
votes
1
answer
234
UGC NET CSE | December 2014 | Part 2 | Question: 14
When an array is passed as parameter to a function, which of the following statements is correct ? The function can change values in the original array. In $C$, parameters are passed by value, the function cannot change the original ... elements in the array. Results in a run time error when the function tries to access the elements in the array.
When an array is passed as parameter to a function, which of the following statements is correct ?The function can change values in the original array. In $C$, parameters...
makhdoom ghaya
1.5k
views
makhdoom ghaya
asked
Jul 20, 2016
Programming and DS
ugcnetcse-dec2014-paper2
programming-in-c
array
+
–
3
votes
1
answer
235
UGC NET CSE | June 2013 | Part 3 | Question: 32
Arrays in C language can have ____ with reference to memory representation. n-subscripts two-subscripts only one subscript three subscripts only
Arrays in C language can have ____ with reference to memory representation.n-subscriptstwo-subscriptsonly one subscriptthree subscripts only
go_editor
1.7k
views
go_editor
asked
Jul 17, 2016
Programming and DS
ugcnetcse-june2013-paper3
programming-in-c
array
+
–
2
votes
2
answers
236
Programming Array
"Arrays have better cache locality that can make them better in terms of performance"--- What does it mean by that ?
"Arrays have better cache locality that can make them better in terms of performance" - What does it mean by that ?
Mj_chain
1.4k
views
Mj_chain
asked
Jun 28, 2016
Programming in C
array
programming-in-c
+
–
6
votes
3
answers
237
ISRO2009-29
A one dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting address of A[49] is 1267 1164 1264 1169
A one dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting addres...
Desert_Warrior
15.7k
views
Desert_Warrior
asked
Jun 3, 2016
Programming in C
isro2009
array
programming
+
–
0
votes
1
answer
238
C \ predict output
int main(){ static int arr[20]; int x=0; arr[x] = x++; printf("\n %d %d %d", arr[0],arr[1],x); } OPTIONS : A) 000 b) 101 c) 001 D) can't say
int main(){ static int arr[20]; int x=0; arr[x] = x++; printf("\n %d %d %d", arr[0],arr ,x); }OPTIONS :A) 000b) 101c) 001D) can't say
Desert_Warrior
718
views
Desert_Warrior
asked
Jun 2, 2016
Programming in C
programming-in-c
output
array
+
–
2
votes
1
answer
239
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.6k
views
Arjun
asked
May 27, 2016
Algorithm Challenges
array
combinatory
placement-questions
+
–
4
votes
2
answers
240
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.5k
views
im.raj
asked
May 24, 2016
Programming in C
placement-questions
array
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
10
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register