Welcome to the Algorithms Problem Set repository! Here, you'll find solutions to four intriguing problems implemented in C++. Each problem comes with a unique approach, and I've provided detailed explanations for better understanding. Let's dive into the challenges:
You are tasked with finding the minimum cost to ferry all cars across the river using ferries with varying costs and capacities. The solution involves a binary search algorithm and a greedy approach.
The code utilizes a binary search to find the optimal cost, considering the ferry's capacity and cost. It efficiently simulates ferry crossings using a greedy algorithm.
In this problem, you'll implement a solution involving the manipulation of two arrays. The goal is to maximize the sum of the maximum values of the arrays, considering specific conditions.
The algorithm uses a greedy approach, iteratively swapping the minimum from array A with the maximum from array B. The provided code is adapted for efficient execution.
The task involves optimizing the execution time of a knapsack problem. You'll modify existing code to efficiently solve a problem related to choosing sushi plates based on weights and values.
The resulting algorithm uses dynamic programming to find the maximum value while considering weights and values of sushi plates.
This problem explores the generation of signals with specific patterns of 0s and 1s. Two types of signals are considered, and the goal is to count the number of signals with a given number of 0s and 1s.
The solution involves a tridimensional matrix to efficiently count the signals based on their patterns. Detailed explanations for both types of signals are provided, and the code is adapted for practical use.
Each problem's solution is contained in a separate folder. You can explore the code and comments within each file for a comprehensive understanding of the implementation.
Feel free to reach out if you have any questions or suggestions for improvement.