Files
hello-algo/ru/codes/go/chapter_greedy/fractional_knapsack_test.go
T
Yudong Jin 772183705e Add ru version (#1865)
* Add Russian docs site baseline

* Add Russian localized codebase

* Polish Russian code wording

* Update ru code translation.

* Update code translation and chapter covers.

* Fix pythontutor extraction.

* Add README and landing page.

* placeholder of profiles

* Use figures of English version

* Remove chapter paperbook
2026-03-28 04:24:07 +08:00

21 lines
525 B
Go

// File: fractional_knapsack_test.go
// Created Time: 2023-07-23
// Author: Reanon (793584285@qq.com)
package chapter_greedy
import (
"fmt"
"testing"
)
func TestFractionalKnapsack(t *testing.T) {
wgt := []int{10, 20, 30, 40, 50}
val := []int{50, 120, 150, 210, 240}
capacity := 50
// Жадный алгоритм
res := fractionalKnapsack(wgt, val, capacity)
fmt.Println("Максимальная стоимость предметов без превышения вместимости рюкзака =", res)
}