Department of Electrical Engineering
Assignment
Date: 21/08/2020
Course Details
Course Title: Data Structure and Algorithm Module:
Instructor: Total 30
Marks:
Student Details
Name: Student ID:
Note: Plagiarism of more than 20% will result in negative marking.
Similar answers of students will result in cancellation of the answer for all parties.
Q1. The following is your sorted array and let assume that you need to search CLO 1
the location of value 31 using binary search.
Marks 10
Q2. Let LA be a Linear Array (Unordered) with N elements and K is a positive CLO 2
integer such that K<=N. Following is the algorithm where ITEM is inserted
into the Kth position of LA-
1. Start
2. Set J=N Marks 10
3. Set N= N+1
4. Repeat steps 5 and 6 while J>=K
5. Set LA [J+1]= LA[J]
6. Set J=J-1
7. Set LA[K]=ITEM
8. Stop
Write the implementation of the above algorithm
Q3. Find a given target number (x=61) using linear Search from a list of CLO 1
number using C++.
[ 18, 36,56,61,73,87,93]
Marks 10