2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -32,8 +32,10 @@ var wants = []item{
|
|||
{"book", 30, 10},
|
||||
}
|
||||
|
||||
const maxWt = 400
|
||||
|
||||
func main() {
|
||||
items, w, v := m(len(wants)-1, 400)
|
||||
items, w, v := m(len(wants)-1, maxWt)
|
||||
fmt.Println(items)
|
||||
fmt.Println("weight:", w)
|
||||
fmt.Println("value:", v)
|
||||
7
Task/Knapsack-problem-0-1/Go/knapsack-problem-0-1-2.go
Normal file
7
Task/Knapsack-problem-0-1/Go/knapsack-problem-0-1-2.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
var wants = []item{
|
||||
{"sunscreen", 15, 2},
|
||||
{"GPS", 25, 2},
|
||||
{"beer", 35, 3},
|
||||
}
|
||||
|
||||
const maxWt = 40
|
||||
Loading…
Add table
Add a link
Reference in a new issue