0% found this document useful (0 votes)
35 views1 page

Assignment - 2 (03 To 09 Aug) (Practice Assignment)

The document outlines 8 programming assignments to be completed between August 3rd and 9th. The assignments include: 1) Creating an array of unique elements from an input array. 2) Finding the kth smallest element from two sorted lists of different sizes. 3) Counting the number of 0s in a very large sorted array containing only 0s and 1s. 4) Implementing linear search. 5) Implementing non-recursive binary search. 6) Implementing bubble sort and measuring runtimes for different input sizes. 7) Implementing insertion sort and measuring runtimes. 8) Implementing merge sort and quick sort.

Uploaded by

Ritik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Assignment - 2 (03 To 09 Aug) (Practice Assignment)

The document outlines 8 programming assignments to be completed between August 3rd and 9th. The assignments include: 1) Creating an array of unique elements from an input array. 2) Finding the kth smallest element from two sorted lists of different sizes. 3) Counting the number of 0s in a very large sorted array containing only 0s and 1s. 4) Implementing linear search. 5) Implementing non-recursive binary search. 6) Implementing bubble sort and measuring runtimes for different input sizes. 7) Implementing insertion sort and measuring runtimes. 8) Implementing merge sort and quick sort.

Uploaded by

Ritik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment - 2

(03 Aug to 09 Aug)

(Practice Assignment)

1) An array ARR of n elements (where elements might not be unique) is given. It is desired to
construct an array ARRNEW from ARR where elements of ARRNEW are the unique elements
of ARR, i.e. if there are N elements in ARR out of which K (K ≤ N) elements are unique then
size of the array ARRNEW is K and will contain all the unique K elements. Propose and
implement an efficient scheme to create the array ARRNEW.
2) You have been given two sorted lists of size M and N. It is desired to find the Kth smallest
element out of M+N elements of both lists. Propose and implement an efficient algorithm to
accomplish the task. Further, propose and implement an efficient algorithm to accomplish
the task considering that elements in both lists are unsorted.
3) You have been given a sorted array ARR (of size M, where M is very large) of two elements,
0 and 1. It is desired to compute the count of 0s in the array ARR. Propose and implement
an efficient algorithm to accomplish the task.
4) Write a program to implement Linear search Algorithm
5) Implement a Binary search Algorithm without recursion
6) Write a program to implement Bubble sort Algorithm, determine the execution time for 100,
1000, 10000 number. (generate input random)
7) Write a program to implement insertion sort Algorithm, determine the execution time for 100,
1000, 10000 number. (generate input random)
8) Write a program to implement merge sort, quick sort Algorithm

You might also like