You are on page 1of 2

Lovely Professional University

School Of Mechanical Engineering

Assignment 1

Subject- INT 322 MM :30

Class-M1961,M1903,M1942

Q1:Incase you have collection of data and you have to arrange them linearly. How will you
arrange the data in Linked or Arrays? Which is better Data structures according to you? Also
give reasons in support of your answer. (5 Marks)

Q-2 R[10][50] is a two dimensional array, which is stored in the memory along the row with
each of its element occupying 8 bytes, find the address of the element R[5][15], if the element
R[8][10] is stored at the memory location 45000. (10 Marks)

Q-3 Calculate the Complexity giving the Big Oh Notation for the code given below

C++ program to illustrate time

// complexity while updating the

// iteration

#include <bits/stdc++.h>

using namespace std;

// Driver Code

int main()

int N = 18;

int i = N, a = 0;
// Iterate until i is greater

// than 0

while (i > 0) {

// Print the value of a

cout << a << ' ';

a = a + i;

// Update i

i = i / 2;

return 0;

Output:
0 18 27 31 33 (5 Marks)

Q-4 Let's consider an array with values {5, 1, 6, 2, 4, 3}.Give a pictorial representation of
how bubble sort will sort the given array, giving the number of passes and comparisions.

(10 Marks)

You might also like