CS 401 group project owned by Soham and Shouvik
• In the given problem, a user can input a list of elements of any particular type, and sort the elements using sorting algorithms, and accordingly decide the most effective sorting algorithm. • Similarly, the user needs to apply searching algorithms on the inputted list, and accordingly decide the most effective searching algorithm. • In the given study sorting algorithm is divided based on the complexity of the algorithm :-
-
High complex sorting algorithm. i. Bubble sort algorithm. ii. Selection sort algorithm.
-
Low complex sorting algorithm. i. Quick sort algorithm. ii. Merge sort algorithm.
• The designed software program allows a user to choose a sorting algorithm out of the two complexities of the sorting algorithm. • It allows the user to compare efficiency out of the two categories of the sorting algorithm by comparing the computed number of comparison of each algorithm. • Secondly, after sorting is performed on the inputted list, we compare the efficiency of the searching algorithm on the same list. • For comparison between searching algorithms, number of comparisons computed by the linear search on unsorted list is compared with the number of comparisons computed by the binary search algorithm on the sorted list. • Hence, in the end a user can come to a conclusion about the more effective sorting algorithm and search algorithm for the inputted list.
The functions used in the software program are as follows:-
- java.util.Arrays
- javax.swing.JOptionPane
- java.util.Scanner
- java.lang.Comparable
- The user first needs to compile the given file : LowComplexity.java, HighComplexity.java and Search.java.
- The user then needs to compile and run the project.java
- Next the user needs to follow instructions given by GUI.
- Select the number of entries.
- Select the datatype of the entries.
- The given input list is printed which was inputted.
- Select the high complexity sorting algorithm
- We get the sorted list and number of comparisons using the high complexity algorithm.
- Similarly, for the low complexity algorithm.
- For searching algorithm, user needs to select the element to be searched.
- The user can more number of sorting and searching algorithms to the menu.
- GUI can be enhanced for better user experience.