Skip to content

Instantly share code, notes, and snippets.

@segomin

segomin/algol.md Secret

Last active July 5, 2024 12:10
Show Gist options
  • Save segomin/0daf889df9015e609c6f2bdbc1d51007 to your computer and use it in GitHub Desktop.
Save segomin/0daf889df9015e609c6f2bdbc1d51007 to your computer and use it in GitHub Desktop.
Algol 연습문제 8.1
H1 = 1
H2 = 3
H3 = H2 + H1 + H2 = 7
H4 = H8 + H1 + H3 = 14 + 1 = 15

가설: Hn 하노이 탑을 옮기는 시간 = 2^n - 1

Hn 의 길이 Tn = T(n-1) + 1 + T(n-1)

T1 = 0 + 1 + 0 = 1
T2 = T1 + 1 + T1 = 2xT1 + 1 = 3
T3 = T2 + 1 + T2 = 2xT2 + 1 = 7

T(n+1) = 2xTn + 1 = 2^n + 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment