Directories are added into the queue recursively.