Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Array_MCQ_with Answer

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
26-12-2023
Written in
2020/2021

This Document helps student to practice mcqs on Arrays of Programming

Institution
Course

Content preview

ACADEMY OF TECHNOLOGY, QUESTION BANK, 2019
Data Structure and Algorithms
Paper code –ES-CS-301
3rd Semester ECE
PART - A
(Multiple Choice Type Questions)
Module – I
Linear Data Structure [Array]
1. The memory address of the first element of an array is called
a) Floor address
b) Foundation address
c) First address
d) Base address
2. Each element of an array arr [20][50] requires 4 bytes of storage. Base address of arr is 2000. The
location of arr[10][10] when the array is stored as column major fashion is
a) 2820 b) 2840 c) 4048 d) 4840

3. The expression that accesses the (i, j) th entry (i=0,1,…m-1,j=0,1,…n-1 of an mn matrix (stored in
column major order) is
a) n  ( i-1)+j b) m(j-1)+i c) n  ( i-1)+ (j-1) d) m(j-1)+ ( i-1)

4. In C language arrays are stored in which representation?
a) Column major b) Row major c) Layer major d) None of these

5. Base address of a floating point 2D array a is 2000. a is stored in row- major order in memory, lower
limit is adapted as 0 and the dimension of a is 4 and 5 respectively. What will be the address of
A[2][3] ?
a) 2022 b) 2052 c)2026 d)2044
6. Dynamic memory allocation use
a) calloc b) malloc c) free d) all of these
7. In C language malloc () returns
a) Integer pointer b) null pointer c) float pointer d) void pointer
8. The expression that accesses the (i,j) th entry of an m × n matrix(stored in column major order) is
a) n ×(i-1) +j b) m × (j-1)+1 c) n × (i -1)+(j-1) d) m × (j-1)+(i-1)

9. An abstract data type (ADT) is
a) Same as an abstract class
b) A data type that cannot be instantiated
c) A data type for which only the operations defined on it can be used but none else
d) None of the above
10. A matrix “a” is called lower triangular if and only if for all j>i, a[i,j]=0. If such a matrix is to be
stored in a one dimensional array, A, then a[i, j] could be mapped to the following index of A:
a) ½*i (i+1) +j b) i + j c) i*(i+1) + j d) None of the these
11. For a strictly lower triangular matrix the element aij, where i is the row and j is the column position
respectively, is 0 for
a) i≠ j b) i<= j c) i> j d) i< j


1

, ACADEMY OF TECHNOLOGY, QUESTION BANK, 2019
Module – II/ Linear Data Structure [Stack and Queue]
12. The following sequence of operations is performed on a stack: push(1,) push(2),pop, push(1),
push(2), pop, pop, pop, push(2 ),pop. The sequence of popped out values are
a) 2,2,1,2,1 b) 2,2,1,1,2 c) 2,1,2,2,1 d) 2,1,2,2,2

13. A stack is implemented using an array with the following declaration:
int stack [100] ; int stacktop=0;
To perform the POP operation, which of the following is correct?
a) x=stack [stacktop++] b) x= stack [++stacktop]
c) x=stack [stacktop--] d) x= stack [--stacktop]

14. Stack is used in
a) Recursion b) Invoking functions c) All of the above d) None of the above

15. The other name for prefix notation is
a) Reverse polish b) Polish c) Infix d) None of the above

16. Stack can be implemented using
a) Arrays b) Linked lists c) both a & b d) None of the above

17. In Stack data structure, insertions and deletions are made at
a) both ends b) one end only c) middle of the stack d) None of the these

18. What is the value of the postfix expression 6 3 2 4 + - *:
a) Something between -15 and -100 b) Something between -5 and -15
c) Something between 5 and -5 d) Something between 5 and 15
e) Something between 15 and 100
19. The operation for adding an entry to a stack is traditionally called:
a) Add b) Append c) Insert d) Push

20. The operation for removing an entry from a stack is traditionally called:
a) Delete b) Peek c) Pop d) Remove

21. Which of the following stack operations could result in stack underflow?
a) Is_empty b) Pop c) Push d) Two or more of the above answers.
22. The postfix equivalent of the prefix *+ab-cd is
a) ab+cd-* b) abcd+-* c) ab+cd*- d) ab+-cd*

23. A postfix expression for the infix expression a+b*(c+d)/f+d*e
a) ab+cd+*f/d+e* b) abcd+*f/+de*+ c) a*b+cd/f*de++ d) None of these

24. A prefix expression for the infix expression a*(b+c)/e-f
a)/*a+bc-ef b) -/*+abcef c) -/*a+bcef d) None of these

25. Translating the infix expression(P) into postfix notation, we get
[P = A + ( B C  ( D / ( E + F ) )  G)  H ]
a) ABC  DEF / + G  H  +
b) ABC  + DEF + /  G  H  +
c) ABC  DEF + / G  H  +
d) None of these
26. Which data structure is needed to convert infix notations to postfix notations?
a) Linear list b) Queue c) Tree d) Stack


2

Written for

Course

Document information

Uploaded on
December 26, 2023
Number of pages
11
Written in
2020/2021
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
sohansarkarm13

Get to know the seller

Seller avatar
sohansarkarm13 Academy of Technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
3
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions