Pergunta de entrevista da empresa Huami

Time complexity of finding an element in a linkedlist,etc. Reverse a binary tree, how do you make a random number in [0,7) if you only have a function which provides the random number in (0,5)?