There is a function in that code to print the elements in order. You can adapt that function so that instead of printing the element it compares it with what you're looking for. This should be quite simple to do.