- Task 1: Implement the bubble sort algorithm to sort an array of numbers in ascending order. Log the sorted array.
- Task 2: Implement the selection sort algorithm to sort an array of numbers in ascending order. Log the sorted array.
- Task 3: Implement the quicksort algorithm to sort an array of numbers in ascending order. Log the sorted array.
- Task 4: Implement the linear search algorithm to find a target value in an array. Log the index of the target value.
- Task 5: Implement the binary search algorithm to find a target value in a sorted array. Log the index of the target value.
- Task 6: Write a function to count the occurrences of each character in a string. Log the character counts.
- Task 7: Write a function to find the longest substring without repeating characters in a string. Log the length of the substring.
- Task 8: Write a function to rotate an array by k positions. Log the rotated array.
- Task 9: Write a function to merge two sorted arrays into one sorted array. Log the merged array.
- Task 10: Write a function to solve the Fibonacci sequence using dynamic programming. Log the Fibonacci numbers.
- Task 11: Write a function to solve the knapsack problem using dynamic programming. Log the maximum value that can be obtained.
- Sorting Algorithm Script: Write a script that implements bubble sort, selection sort, and quicksort algorithms to sort arrays.
- Searching Algorithm Script: Create a script that implements linear search and binary search algorithms to find values in arrays.
- String Algorithm Script: Write a script that counts character occurrences and finds the longest substring without repeating characters.
- Array Algorithm Script: Create a script that rotates arrays and merges sorted arrays.
- Dynamic Programming Script: Write a script that solves the Fibonacci sequence and knapsack problem using dynamic programming.
By the end of these activities, students will:
- Implement and understand common sorting algorithms.
- Implement and understand common searching algorithms.
- Solve string and number-related problems using algorithms.
- Perform array operations using algorithms.
- Apply dynamic programming to solve complex problems (optional).