Assignment 2 (DSA)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY

SOFTWARE ENGINEERING DEPARTMENT


Fall 2021
Data Structures and Algorithms
Assignment 2
Semester: III Batch: 2020F
Due Date: 29-11-2021 Max Marks: 10

Instructions:
 Solution must be in Handwritten form.
 Solution must be provided in group of 4 students.
 Late Submissions will not be acknowledged.

Question 1
Consider the following array

3 16 -1 0 8 7 1 55 -3 1
a. Insert “74” at 4 position of an array.
th

b. Delete “8” from the above array.

Question 2
a. Solve the following array by using Selection Sort and Merge Sort of the given linear array.

3 16 -1 0 8 7 1 55 -3 1
Array-1
b. Find the element 8 from Array-1, -3 by using Linear and Binary search.

Question 3
Solve the following array(Array-2) by using Quick Sort and Bubble Sort of the following linear array.

Was Had Him And You His The But

Array-2

Question 3
A matrix B[1…10][1…20] is stored in the memory with each element requiring 2 bytes of storage. If the
base address is 2140, find the address of B[5][4] when the matrix is stored in Column Major Wise.

Question 4
A matrix ARR[-4…6, 3…8] is stored in the memory with each element requiring 4 bytes of storage. If
the base address is 1430, find the address of ARR[3][6] when the matrix is stored in Row Major Wise.
Question 5
Find where the indicated elements of an array LA are stored, if the base address of LA is 200 and LB =
0.
a. double LA[12]; LA[3] ?
b. int LA[26]; LA[2] ?
Assume that int(s) are stored in 4 bytes and double(s) in 8 bytes.

You might also like