Home >>
Assignments >>
computer_science >>
Using a programming language of your choice, write, test, and debug a program that includes the following features:

Using a programming language of your choice, write, test, and debug a program that includes the following features:

1. An implementation of bubblesort with the following method signature: void bubblesort(int[] arr)

2. An implementation of a sorting algorithm of your choice with the following method signature: void [algorithmname](int[] arr)

3. An implementation of bubblesort with the following method signature: void bubblesort(String[] arr)

4. An implementation of a sorting algorithm of your choice with the following method signature: void [algorithmname](String[] arr)

5. An implementation of a linear search with the following method signature (the method should return -1 if the item is not found): int linearSearch(int[] arr, int valueToFind)

6. An implementation of a binary search with the following method signature (the method should return -1 if the item is not found): int binarySearch(int[] arr, int valueToFind)

7. An implementation of a linear search with the following method signature (the method should return -1 if the item is not found): int linearSearch(String[] arr, String valueToFind ) 8. An implementation of a binary search with the following method signature (the method should return -1 if the item is not found): int binarySearch(String [] arr, String valueToFind) 9. An implementation of a Hashtable class with the following methods: void add(string key, string value) string remove(string key) /* returns the removed value or NULL if it did not exist in the table */ bool contains(string key) int getCount() /* the number of items in the table */

10. A main method that demonstrates each algorithm and its results.

You may define auxiliary methods or variables as needed.

class Algorithms{

public static void bubblesort(int[] arr){

int n=arr.length;

for (int i=0;i < n-1;i++) {

for (int j=0;j < n-1;j++) {

if(arr[j] > arr[j+1]){

- Certified Editors
- 24/7 Customer Support
- Profesional Research
- Easy to Use System Interface
- Student Friendly Pricing