Sunday 2 April 2017

DSA Lab 2 - Implementation of Sorting and searching algorithms

Task # 1:
Implement the following sorting algorithms:

  • Selection sort
  • Insertion sort
  • Quick sort
  • Merge sort
  • bubble sort
Note: Your Implementation should contain a class named "mySort". You have to write a separate function of all above mentioned sorting algorithms in your class "mySort". Then you can call and test your algorithms in Main as "mySort.selectionSort()". In your main function you have to take input from a file "input.txt" and show the results on console.

Task # 2:

Implement the following sorting algorithms:

  • Binary Search
Your have to perform binary search on strings this time. (Hint: convert word into number by adding up the ASCII code of each letter in the word.)

Note: Your Implementation should contain a class named "mySearch". You have to write a separate function of binary search algorithm in your class "mySearch". Then you can call and test your algorithms in Main as "mySearch.binarySearch()". In your main function you have to take input from a file "input.txt" and show the results on console.

No comments :

Post a Comment