A method of allocating CDMA codes from a set of the same is provided for use
in
connection with a wireless network. The method includes, after identifying a desired
size of the code to be allocated, determining if there exists a code of the desired
size whose sibling is unavailable. If such a code is found, then it is allocated.
Otherwise, it is determined if there exists a code of smaller than the desired
size whose sibling is unavailable. When such a code (i.e., a code of smaller than
the desired size whose sibling is unavailable) is found, a descendant thereof which
has the desired size is allocated.