Managing an hotel using AVL trees - Data Structures
Maintain an AVL tree $T$ containing the indices of the unoccupied rooms. For each vertex $v$ of the tree additionally maintain the number $\eta(v)$ of vertices in the subtree of $T$ rooted at $v$.

1) Init: create an AVL tree with keys $\{1, \dots, n\}$. This requires $O(n)$ time.

2) GetUnOcc($l$, $r$): Find the vertex $u$ associated with the successor of $l$ in $T$ (possibly $l$ itself). Find the vertex $v$ associated with the predecessor of $r$ in $T$ (possibly $r$ itself). If the key of $u$ is larger than the key of $v$ return $0$. Otherwise find the least common ancestor $w$ of $l$ and $r$. Initialize the number $x$ of unoccupied rooms to $0$.
Walk from $u$ (inclusive) to $w$ (exclusive). Whenever you encounter a vertex $z$ such that $z=u$ or the previous vertex in the walk was the left child of $z$, let $z'$ be the right child of $z$ (if any) and add $1 + \eta(z')$ to $x$ (if $z'$ does not exist then add $1$ to $x$).
Walk from $v$ (inclusive) to $w$ (exclusive). Whenever you encounter a vertex $z$ such that $z=v$ or the previous vertex in the walk was the right child of $z$, let $z'$ be the left child of $z$ (if any) and add $1 + \eta(z')$ to $x$ (if $z'$ does not exist then add $1$ to $x$). Return $1+x$.

3) GetMinUnOcc($l$, $r$): Search for the vertex $u$ associated with the successor of $l$ in $T$ (where the successor of $l$ might be $l$ itself). 
If the key of $u$ is at most $r$, delete $u$ from the tree subtract $1$ from the values $\eta(z)$ of all proper ancestors $z$ of $u$.
Otherwise all rooms between $l$ and $r$ are already occupied. 

4) GetOut(r): Insert a new vertex $z$ with key $r$ into the tree with $\eta(z)=1$. Increment by $1$ the values $\eta(z')$ of all the proper ancestors $z'$ of $z$.