You are on page 1of 9

5/15/22, 10:31 AM 1st Module Assessment

Dashboard / My courses / 2_Sem 2_CSIT124 / Module 1 Introduction to Data Structures / 1st Module Assessment

Question 1

Not yet answered

Marked out of 1.00

The memory address of the first element of an array is called

Select one:
a. floor address
b. foundation address
c. first address
d. base address
Clear my choice

Question 2

Not yet answered

Marked out of 1.00

In general, the index of the first element in an array is __________

Select one:
a. 0
b. -1
c. 2
d. 1
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 1/9
5/15/22, 10:31 AM 1st Module Assessment

Question 3

Not yet answered

Marked out of 1.00

When does the ArrayIndexOutOfBoundsException occur?

Select one:
a. Compile-time
b. Run-time
c. Not an error
d. Not an exception at all
Clear my choice

Question 4

Not yet answered

Marked out of 1.00

Which of these best describes an array?

Select one:
a. A data structure that shows a hierarchical behavior
b. Container of objects of similar types
c. Arrays are immutable once initialised
d. Array is not a data structure
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 2/9
5/15/22, 10:31 AM 1st Module Assessment

Question 5

Not yet answered

Marked out of 1.00

How do you initialize an array in C?

Select one:
a. int arr[3] = (1,2,3);
b. int arr(3) = {1,2,3};
c. int arr[3] = {1,2,3};
d. 1. int arr(3) = (1,2,3);
Clear my choice

Question 6

Not yet answered

Marked out of 1.00

Two-dimensional arrays are also called

Select one:
a. tables arrays
b. matrix arrays
c. both of above
d. none of the above
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 3/9
5/15/22, 10:31 AM 1st Module Assessment

Question 7

Not yet answered

Marked out of 1.00

What are the advantages of arrays?

Select one:
a. Objects of mixed data types can be stored
b. Elements in an array cannot be sorted
c. Index of first element of an array is 1
d. Easier to store elements of same data type
Clear my choice

Question 8

Not yet answered

Marked out of 1.00

Which of the following highly uses the concept of an array?

Select one:
a. Binary Search tree
b. Caching
c. Spatial locality
d. Scheduling of Processes
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 4/9
5/15/22, 10:31 AM 1st Module Assessment

Question 9

Not yet answered

Marked out of 1.00

Assuming int is of 4bytes, what is the size of int arr[15];?

Select one:
a. 15
b. 19
c. 11
d. 60
Clear my choice

Question 10

Not yet answered

Marked out of 1.00

Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct.

Select one:
a. Find the ith largest element
b. Delete an element
c. Find the ith smallest element
d. All of the above
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 5/9
5/15/22, 10:31 AM 1st Module Assessment

Question 11

Not yet answered

Marked out of 2.00

Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of
A[11, 5] ? Assume row major storage.

Select one:
a. 560
b. 565
c. 570
d. 575
Clear my choice

Question 12

Not yet answered

Marked out of 2.00

A program P reads in 500 integers in the range [0..100] exepresenting 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?

Select one:
a. An array of 50 numbers
b. An array of 100 numbers
c. An array of 500 numbers
d. A dynamically allocated array of 550 numbers
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 6/9
5/15/22, 10:31 AM 1st Module Assessment

Question 13

Not yet answered

Marked out of 2.00

What is the output of the below code?

#include <stdio.h>

int main()

int arr[5]={10,20,30,40,50};
printf("%d", arr[5]);

return 0;

Select one:
a. Garbage value
b. 10
c. 50
d. None of the above
Clear my choice

Question 14

Not yet answered

Marked out of 2.00

Which of the following is an illegal array definition?

Select one:
a. Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL;
b. var a : array [REAL] of REAL;
c. var a : array [‘A’…’Z’] of REAL;
d. var a : array [BOOLEAN] of REAL;
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 7/9
5/15/22, 10:31 AM 1st Module Assessment

Question 15

Not yet answered

Marked out of 4.00

Let A be a square matrix of size n x n. Consider the following program. What is the expected output?

C = 100

for i = 1 to n do

for j = 1 to n do

Temp = A[i][j] + C

A[i][j] = A[j][i]
A[j][i] = Temp - C

for i = 1 to n do

for j = 1 to n do

Output(A[i][j]);

Select one:
a. The matrix A itself
b. Transpose of matrix A
c. Adding 100 to the upper diagonal elements & subtracting 100 from diagonal elements of A
d. None of the above
Clear my choice

Question 16

Not yet answered

Marked out of 4.00

What will be the address of the arr[2][3] if arr is a 2-D long array of 4 rows and 5 columns and starting address of the array is
2000?

Select one:
a. 2048
b. 2056
c. 2052
d. 2042
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 8/9
5/15/22, 10:31 AM 1st Module Assessment

Question 17

Not yet answered

Marked out of 4.00

What is the output of the following piece of code?

public class array


◄ Test
{ Your Understanding 1.4.2 Sparse matrix

public
Jump to... static void main(String args[])
{
Module 1 Feedback Form ►
int []arr = {1,2,3,4,5};

System.out.println(arr[2]);

System.out.println(arr[4]);

Select one:
a. 3 and 5
b. 5 and 3
c. 2 and 4
d. 4 and 2
Clear my choice

https://amigo.amityonline.com/mod/quiz/attempt.php?attempt=3605360&cmid=143485#question-3615167-4 9/9

You might also like