Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
musicinformationretrieval-com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
A.S.
musicinformationretrieval-com
Commits
61341eb3
Commit
61341eb3
authored
Jul 28, 2018
by
Steve Tjoa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic programming
parent
5c91fb22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
dp.ipynb
dp.ipynb
+14
-19
No files found.
dp.ipynb
View file @
61341eb3
...
...
@@ -7,7 +7,6 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"import seaborn\n",
"import numpy, scipy, scipy.spatial, matplotlib.pyplot as plt\n",
"plt.rcParams['figure.figsize'] = (14, 2)"
]
...
...
@@ -86,9 +85,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"def min_coin_sum(val, coins=None):\n",
...
...
@@ -108,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count":
3
,
"execution_count":
4
,
"metadata": {},
"outputs": [
{
...
...
@@ -125,9 +122,9 @@
],
"source": [
"coins = [1, 5, 10, 25]\n",
"print
'val num_coins'
\n",
"print
('val num_coins')
\n",
"for val in (1, 6, 42, 49):\n",
" print
'%3d %d' % (val, min_coin_sum(val, coins
))"
" print
('%3d %d' % (val, min_coin_sum(val, coins)
))"
]
},
{
...
...
@@ -153,10 +150,8 @@
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"def min_coin_sum(val, coins=None):\n",
...
...
@@ -174,7 +169,7 @@
},
{
"cell_type": "code",
"execution_count":
5
,
"execution_count":
6
,
"metadata": {},
"outputs": [
{
...
...
@@ -192,9 +187,9 @@
],
"source": [
"coins = [1, 5, 10, 25]\n",
"print
'val num_coins'
\n",
"print
('val num_coins')
\n",
"for val in (1, 6, 42, 49, 52):\n",
" print
'%3d %d' % (val, min_coin_sum(val, coins
))"
" print
('%3d %d' % (val, min_coin_sum(val, coins)
))"
]
},
{
...
...
@@ -214,21 +209,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python
2
",
"display_name": "Python
3
",
"language": "python",
"name": "python
2
"
"name": "python
3
"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version":
2
"version":
3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython
2
",
"version": "
2.7.13
"
"pygments_lexer": "ipython
3
",
"version": "
3.6.4
"
}
},
"nbformat": 4,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment