Posts

Showing posts from October, 2025

Fractional Knapsack Problem Example Solution — Greedy Algorithm for Maximum Profit

Lecture Link In this lecture, we apply the Fractional Knapsack Algorithm to a real-world scenario — a store owner trying to display the most profitable fruits on a limited-weight table. 🏪🍎 You’ll learn how the greedy method works, why it’s optimal for divisible items, and how to calculate the maximum total value using value per kilogram. We’ll go through the full reasoning: 1-Defining the problem and scenario 2-Computing value densities for each fruit 3-Filling the 30 kg capacity step by step 4-Showing exactly how much of each fruit to take 5-Calculating the final maximum profit = $222 This example will help you understand how greedy algorithms make optimal decisions for fractional knapsack problems and how to reason through each step manually.

Fractional Knapsack Explained — Greedy Algorithm Step-by-Step

Lecture Link In this lecture, we introduce the Fractional Knapsack Problem, one of the most important applications of the Greedy Algorithm in optimization. You’ll learn why we use it, where it applies in the real world, and how to design the algorithm step by step. We’ll walk through the intuitive idea behind value-per-weight (density), explore practical examples like resource allocation and profit maximization, and write the pseudoalgorithm you’ll use to solve problems in the next lecture.

Regular Expressions with Examples

Lecture Link In this video, we break down regular expressions (regex) step by step — from the basic building blocks to how they form regular languages. You’ll learn: 1- The three core operations: Concatenation, Union, and Kleene Star 2- The difference between the empty string (ε) and the empty set (∅) 3- The distinction between Kleene Star (★) and the plus (+) operator 4- How regex compares to arithmetic operations with simple analogies 5- Solved examples to help you actually use these operations By the end, you’ll understand how regular expressions are built, how they define regular languages, and why they’re such a powerful tool in computer science. If you’re a student, developer, or just curious about how search patterns and compilers work, this video is for you!