Discrete mathematics with applications
Discrete mathematics with applications
Database Management Systems
Computers and Intractability: A Guide to the Theory of NP-Completeness
Computers and Intractability: A Guide to the Theory of NP-Completeness
Towers of Hanoi revisited a nonrecursive surprise
ACM SIGPLAN Notices
Hi-index | 0.00 |
In this paper, four algorithms are presented, the first of which generates the binary numbers for a given number of bits. The remaining three algorithms are applications of the binary numbers to set theory, database, and the Tower of Hanoi. For set theory, the power set of a finite set is produced. The database application generates a list of superkeys, among which are the candidate keys, of a relational database, relating this to determining the minimal elements in the Hasse Diagram of the underlying partial order. The final application solves the well-known Tower of Hanoi problem by simply counting in binary. The implementation of each of these algorithms is an excellent programming exercise for students.