ES 102 - Introduction To Computing Lab Assignment - 6: November 6, 2015

You might also like

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

ES 102 - Introduction to Computing

Lab Assignment - 6

November 6, 2015

1. Write a program to perform linear and binary search for a given integer
on a given sorted list of integers.
2. Write a program to take a sorted list as input and generate an unsorted
list using Knuths shuffling.
3. Write a program to search and replace all the occurrences of an integer
with a new integer in a given sorted list. Print the modified list.
4. Write a program to delete all the occurrences of an integer from a
sorted list and create a modified list. Print the modified list.
5. Develop a modified binary search algorithm that uses a random number generator which always generates random numbers in the range
lower and upper. In each instance the random number generated
should take on the role of the middle in the binary search. Compare
the performance of this algorithm with the binary search algorithm in
terms of the number of comparisons made.
6. Design a modified insertion sort algorithm that uses binary search to
speed up the location of the insertion position.

You might also like