Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prm2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
prm2
Commits
9304c9e3
Commit
9304c9e3
authored
5 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
gen-k1: Oprava překlepu
parent
f4fce2fd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
07-rekurze/gen-k1.py
+1
-1
1 addition, 1 deletion
07-rekurze/gen-k1.py
with
1 addition
and
1 deletion
07-rekurze/gen-k1.py
+
1
−
1
View file @
9304c9e3
...
...
@@ -31,7 +31,7 @@ def countk1(n, k):
result
+=
countk1
(
n
-
1
,
k
-
1
)
return
result
### Počíta
č
í funkce je ovšem pomalá: výsledek je kombinační číslo (poznáváte
### Počíta
c
í funkce je ovšem pomalá: výsledek je kombinační číslo (poznáváte
### v naší funkci součtový vzorec z Pascalova trojúhelníku?) a nasčítáme ho
### postupně z jedniček. Přitom "n nad n/2" je řádově 2^n / √n. Stejně jako
### u příkladu s Fibonacciho čísly si můžeme mezivýsledky pamatovat a tím
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment