하노이 탑을 풀어보자

Tags:

이정도코드를 써놓는다면 진짜 mania라고 할 수 있지 않을까…

———————

헐.. hanoi 탑을 풀어봅시다..-_-;;
name : 이민 hits: 10 / date : 2003.12.31 00:57:00

Some problems, which are presented in algorithm textbooks as ideal candidates for recursion, turn out to be much better suited to iteration:

max = 1 << no_of_discs; for (x = 1; x < max; x++) printf("move a disc from %d to %d\n", (x&x-1)%3, ((x|x-1)+1)%3); -_-;; 대략 멍... 잠이나 자야지..-_-; 서민구 : 뭐야 이코드는 -_-; 코드는 좋은데 설명이 별로네. (12.31 01:41) 서민구 : can be easily transformed into iterative form. 이라고 하면 더 얄미울것인데.. ㅋㅋㅋ.. (12.31 01:42) 서민구 : 자야지 -_- (12.31 01:42)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *