menu
Recent questions tagged arrays
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Recent questions tagged arrays
All Activity
Q&A
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Blogs
Previous Year
Recent questions tagged arrays
0
votes
0
answers
1.5k
views
GATE CSE 2021 Set 2 | Question: 10 | Video Solution
Arjun
asked
in
Programming
Feb 18, 2021
by
Arjun
1.4k
points
1.5k
views
gate2021-cse-set2
programming-in-c
arrays
output
0
votes
1
answer
1.6k
views
GATE CSE 2021 Set 1 | Question: 2 | Video Solution
Arjun
asked
in
DS
Feb 18, 2021
by
Arjun
1.4k
points
1.6k
views
gate2021-cse-set1
data-structures
arrays
0
votes
1
answer
96
views
TGA Material
Code: #include <stdio.h> #define TOTAL_ELEMENTS(sizeof(array))/sizeof(array[0]) int array[ ]={23,34,17,204,99,16}; int main() { int d; printf("%d",TOTAL_ELEMENTS); for (d=-1;d<=(TOTAL_ELEMENTS - 2);d++) printf ("%d",array[d+1]); return 0; } What is the output of the above code?
Enolx.21
asked
in
Programming
Dec 30, 2020
by
Enolx.21
53
points
96
views
arrays
0
votes
0
answers
26
views
introduction to Arrays section from geeksforgeeks
Is it possible to declare any array of below type? // declare an array of user specified size int n = 10; int arr2[n];
suryavasu1012
asked
in
Programming
Dec 16, 2020
by
suryavasu1012
9
points
26
views
arrays
0
votes
1
answer
107
views
C- Programming Question on Pointers
What will be the output of the following program? #include "stdio.h" int main() { char a[] = { 'P', 'Q', 'R', 'S' }; char* p = &a[0]; *p++; printf("%c ", *++p); } According to my solution As we know that ... answer comes out to be Q , but when I ran the program, then it showed my R as the output. Can someone please help me with this?
Samarth Kejriwal
asked
in
Programming
Dec 2, 2020
by
Samarth Kejriwal
7
points
107
views
programming
pointers
arrays
1
vote
1
answer
131
views
Made easy Test Series
What would be the output? #include <stdio.h> void print(int arr[]) { int n,i; n=sizeof(arr)/sizeof(arr[0]); for(i=0; i<=n/2; i++) printf("\n%d,%d ",i,arr[i+5]); } int main() { int arr[]={10,20,30,40,50,60,70,80}; print(arr); return 0; }
naveen_168
asked
in
Programming
Nov 5, 2020
by
naveen_168
13
points
131
views
arrays
0
votes
0
answers
97
views
Understanding pointers in C (Yashavant Kanetkar)
Can anyone please provide the output of the below code with proper explanation:- #include <stdio.h> show(int(*q)[3][4],int ii,int jj,int kk){ int i,j,k; int *p; for(i=0;i<ii;i++){ for(j=0;j<jj;j++){ p=q[i][j]; printf("\nThis is %d\n",q[i][ ... 7,8, 9,3,2,1}, { 2,3,5,7, 4,3,9,2, 1,6,3,6} }; show(a, 2, 3,4 ) ; } Thanks in advance.
Pratyush Priyam Kuan
asked
in
Programming
Sep 9, 2020
by
Pratyush Priyam Kuan
1.1k
points
97
views
pointers
programming
arrays
0
votes
1
answer
1.5k
views
GeekForGeeks
Consider an array consisting of –ve and +ve numbers. What would be the worst case time complexity of an algorithm to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other ? A) O(N) B) O(N Log N) C) O(N * N) D) O(N Log Log N)
Musa
asked
in
DS
Aug 21, 2020
by
Musa
5
points
1.5k
views
arrays
time-complexity
0
votes
1
answer
64
views
UGC NET CS 2016 July – III
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 ? A) n(n-1)/2 B) n(n-1)/4 C n(n+1)/4 D 2n[logn]
Musa
asked
in
DS
Aug 21, 2020
by
Musa
5
points
64
views
ugc-net
arrays
0
votes
2
answers
840
views
Array-Programming
#include <stdio.h> int main() { char p; char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8}; p = (buf + 1)[5]; printf("%dn", p); return 0; } what is the output of this code ?
val_pro20
asked
in
Programming
Aug 16, 2020
by
val_pro20
2
points
840
views
programming
programming-in-c
arrays
0
votes
0
answers
113
views
pointers in 2d array
according to me answer is 1(3rd one ) but they have given 2 (2nd and 3rd ) are correct how can II be correct function signature?
abcd9982
asked
in
Programming
Jul 2, 2020
by
abcd9982
87
points
113
views
made-easy-test-series-programming-language
arrays
pointers
0
votes
1
answer
107
views
2D Arrays from made easy test series topic test 1
The 2d array is given as A[0...39,0...39].What is the location of A[15][25] if row major order is followed along with lower triangular matrix?base address is 500 and char takes 1byte of memory.
Barsha Banik
asked
in
Programming
Jun 25, 2020
by
Barsha Banik
5
points
107
views
arrays
0
votes
0
answers
233
views
Self doubt-Arrays
Question: #include <stdio.h> #include <string.h> int main(void) { char line[100] = "hello\n"; printf( "%zu ", strlen( line ) ); return 0; } The output of the above program is: _____ ?
Swati Dubey
asked
in
Programming
Jun 8, 2020
by
Swati Dubey
7
points
233
views
arrays
0
votes
0
answers
29
views
GATE1994-1.11 Video Solution
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the ... is: $i+j$ $i+j-1$ $(j-1)+\frac{i(i-1)}{2}$ $i+\frac{j(j-1)}{2}$
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
29
views
gate1994
data-structures
arrays
normal
video-solution
0
votes
0
answers
26
views
GATE2005-5 Video Solution
A program $P$ reads in $500$ integers in the range $[0, 100]$ representing the scores of $500$ students. It then prints the frequency of each score above $50$. What would be the best way for $P$ to store the frequencies? An array of $50$ numbers An array of $100$ numbers An array of $500$ numbers A dynamically allocated array of $550$ numbers
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
26
views
gate2005
data-structures
arrays
easy
video-solution
0
votes
0
answers
23
views
GATE2014-3-42 Video Solution
Consider the C function given below. Assume that the array $listA$ contains $n (>0)$ elements, sorted in ascending order. int ProcessArray(int *listA, int x, int n) { int i, j, k; i = 0; j = n-1; do { k = (i+j)/2; if (x ... implementation of binary search. It will always find the maximum element in $listA$. It will return −$1$ even when $x$ is present in $listA$.
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
23
views
gate2014-3
data-structures
arrays
easy
video-solution
0
votes
0
answers
19
views
GATE2015-2-31 Video Solution
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 _____.
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
19
views
gate2015-2
databases
arrays
normal
numerical-answers
video-solution
0
votes
0
answers
16
views
GATE2013-50 Video Solution
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$ ... given above, how many test cases will be able to capture the flaw? Only one Only two Only three All four
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
16
views
gate2013
data-structures
arrays
normal
video-solution
0
votes
0
answers
23
views
GATE1998-2.14 Video Solution
Let $A$ be a two dimensional array declared as follows: A: array [1 …. 10] [1 ….. 15] of integer; Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the array is stored at location $100$, what is the address of the element $A[i][j]$? $15i+j+84$ $15j+i+84$ $10i+j+89$ $10j+i+89$
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
23
views
gate1998
data-structures
arrays
easy
video-solution
0
votes
0
answers
26
views
GATE2000-1.2 Video Solution
An $n \times n$ array $v$ is defined as follows: $v\left[i,j\right] = i - j$ for all $i, j, i \leq n, 1 \leq j \leq n$ The sum of the elements of the array $v$ is $0$ $n-1$ $n^2 - 3n +2$ $n^2 \frac{\left(n+1\right)}{2}$
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
26
views
gate2000
data-structures
arrays
easy
video-solution
0
votes
0
answers
18
views
GATE2013-51 Video Solution
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
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
18
views
gate2013
data-structures
arrays
normal
video-solution
0
votes
0
answers
10
views
GATE2000-15 Video Solution
Suppose you are given arrays $p [1......N]$ and $q [1......N]$ both uninitialized, that is, each location may contain an arbitrary value), and a variable count, initialized to $0$. Consider the following procedures $set$ and $is\_set$: set(i) { count = ... $set(i)$ has not been called for some $i$, then regardless of what $p[i]$ contains, $is\_set(i)$ will return false.
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
10
views
gate2000
data-structures
arrays
easy
descriptive
video-solution
0
votes
0
answers
38
views
GATE1993-12 Video Solution
The following Pascal program segments finds the largest number in a two-dimensional integer array $A[0\dots n-1, 0\dots n-1]$ using a single loop. Fill up the boxes to complete the program and write against $\fbox{A}, \fbox{B}, \fbox{C} \text{ and } \fbox{D}$ in your answer book ... A[i, j]>max then max:=A[i, j]; if |C| then j:=j+1; else begin j:=0; i:=|D| end end end
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
38
views
gate1993
data-structures
arrays
normal
video-solution
0
votes
0
answers
20
views
GATE1997-17 Video Solution
An array $A$ contains $n \geq 1$ positive integers in the locations $A[1], A[2], \dots A[n]$. The following program fragment prints the length of a shortest sequence of consecutive elements of $A$, $A[i], A[i+1], \dots,A[j]$ ... = ◻ end else begin if(j-i) < min then min:=j-i; sum:=sum -A[i]; i:=i+1; end writeln (min +1); end.
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
20
views
gate1997
data-structures
arrays
normal
video-solution
0
votes
0
answers
29
views
GATE1994-25 Video Solution
An array $A$ contains $n$ integers in non-decreasing order, $A[1] \leq A[2] \leq \cdots \leq A[n]$. Describe, using Pascal like pseudo code, a linear time algorithm to find $i, j,$ such that $A[i]+A[j]=a$ given integer $M$, if such $i, j$ exist.
admin
asked
in
DS
Apr 18, 2020
by
admin
589
points
29
views
gate1994
data-structures
arrays
normal
video-solution
0
votes
1
answer
72
views
Made Easy test series algorithm complexity occurance of element more than 2n/3 times
Ram Swaroop
asked
in
Algorithms
Jan 26, 2020
by
Ram Swaroop
393
points
72
views
made-easy-test-series
time-complexity
algorithms
arrays
0
votes
1
answer
140
views
Self doubt-ARRAY
$\text{Consider a lower triangular matrix}$ $a[25….200,25….200]$ $Find\ loc[190][150]=?$ $\text{Using Column major order.}$
KUSHAGRA गुप्ता
asked
in
Programming
Dec 27, 2019
by
KUSHAGRA गुप्ता
1.4k
points
140
views
data-structures
column-major
row-major
arrays
0
votes
0
answers
59
views
10. Ace Academy Booklet
An $\mathbf{n\times n}$ matrix $\mathbf{T}$ is a $\textbf{Toeplitz matrix}$ iff $\text{T(i,j) = T(i-1,j-1)}$ for all $\mathrm i$ and $\mathrm j$, $\mathrm{i >1}$ and $\mathrm{j>1}$. If the $\textbf{TOEPLITZ}$ matrix of order $(5,5)$ is stored in one dimensional array, then optimum number of elements stored is ____________________.
`JEET
asked
in
Programming
Dec 22, 2019
by
`JEET
191
points
59
views
arrays
0
votes
1
answer
53
views
11. Ace Academy Booklet, Array
A $\textbf{square band matrix}\;\mathrm{D_{n,a}}$ is an $\mathrm{n\times n}$ matrix in which all the non-zero terms lie in a band centred around the main diagonal. The band includes the main diagonal and $\mathrm{a-1}$ diagonal below and above the main diagonal. The number of elements in hte band $\mathbf{D_{1000,101}}$_______________.
`JEET
asked
in
Programming
Dec 22, 2019
by
`JEET
191
points
53
views
arrays
0
votes
0
answers
156
views
12. Array Ace Academy Booklet
Store only the lower diagonal of $\textbf{Symmetric Square Band Matrix}\;\mathrm{ N\times N}$ in the style of diagonal by diagonal, starting from the lowest diagonal, including main diagonal then calculate the retriveing formula (Assume that ... to solve these questions through a proper procedure which I don't know but looking to learn from the community. Thanks.
`JEET
asked
in
Programming
Dec 22, 2019
by
`JEET
191
points
156
views
arrays
matrices
1
vote
2
answers
269
views
Self Doubt-Arrays
$3-d\ array:$ $A[5….11,3…7,6….16]$ Using column major order and row major order find: $location\left ( A[9][5][14] \right )=?$ take BA: 1000 and int size: 10 bytes
KUSHAGRA गुप्ता
asked
in
DS
Dec 11, 2019
by
KUSHAGRA गुप्ता
1.4k
points
269
views
data-structures
arrays
column-major
0
votes
1
answer
688
views
ME - test series
Consider 3 dimensional array $A[90][30][40]$ stored in linear array in column major order, if the base address starts at $10$, what is the location of $A[20][20][30]$? Assume the first element is stored at $A[1][1][1]$. Solution given is: But I think that is row major order. Isn’t it?
Vimal Patel
asked
in
DS
Dec 4, 2019
by
Vimal Patel
1.6k
points
688
views
dsa
arrays
column-major
0
votes
1
answer
58
views
Made easy DS doubt
Priyansh Singh
asked
in
Programming
Nov 14, 2019
by
Priyansh Singh
229
points
58
views
arrays
0
votes
0
answers
81
views
programming test series question made easy
Priyansh Singh
asked
in
Programming
Oct 11, 2019
by
Priyansh Singh
229
points
81
views
arrays
programming-in-c
0
votes
0
answers
41
views
Made Easy Programming and DS test 1
luc_Bloodstone
asked
in
Programming
Oct 1, 2019
by
luc_Bloodstone
19
points
41
views
arrays
programming
0
votes
0
answers
106
views
Made Easy Test Series (Programming).
Consider a two-dimensional array with the elements stored in the form of lower triangular matrix, The elements must be crossed to read A[4,2] from the array A[-6,…..,+8,-6,…..,+8] whose base address 1000 is _________ ? (Assume elements are stored in Row Major Order).
Priyansh Singh
asked
in
Programming
Sep 23, 2019
by
Priyansh Singh
229
points
106
views
arrays
0
votes
1
answer
83
views
TSPGECET-2019-CSE-26
Consider the following declaration of a two – dimensional array in C char a[50][50]; Assuming that the main memory is byte – addressable and that the array is stored starting from memory address $0$, the address of $a[20][25]$ is: $2020$ $2525$ $2025$ $2050$
Shiva Sagar Rao
asked
in
Others
Aug 13, 2019
by
Shiva Sagar Rao
35
points
83
views
tspgecet-cse-2019
arrays
0
votes
1
answer
60
views
character array and string
what is the difference between char str1[25]; //this is taking characters and char str2[25][25]; //this is taking strings being confusing that why the str1 is taking characters and str2 is taking strings
shiva0
asked
in
Programming
Jun 23, 2019
by
shiva0
9
points
60
views
character
arrays
string
programming
To see more, click for the
full list of questions
or
popular tags
.
Ask a Question
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Recent Posts
New GATEOverflow PDFs
Guidelines to users
No Recent Blog Comments
Search GATE CSE Video Solutions