Skip to content

jueeeeeen/404-Hotel-Not-Found

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🏨 404 Hotel Not Found

A Python implementation of Hilbert’s Hotel using data structures and algorithms, developed as part of the Object-Oriented Data Structures course.

🧠 Hilbert's Hotel

A hotel with an infinite number of rooms, all already occupied, but it can still admit new guests by shifting every guest to the next room.

💡 Solution

The main goal is to minimize the number of unoccupied rooms while preventing room numbers from growing excessively large.

🛠️ Data Structure Representation

An AVL tree is used to represent the hotel, with each node corresponding to a hotel room.

🔢 Room Number Computation

Room numbers are computed using the Morton Curve (Z-order Curve), a non-overlapping space-filling curve that guarantees unique room numbers without repetition.

🚀 How to run

python 404_Hotel_Not_Found.py

About

A Python implementation of Hilbert’s Hotel using data structures and algorithms, developed as part of the Object-Oriented Data Structures course.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages