Hello!
What type of data structure do you use to do your search.
It is not clear from your post.
In
java you can use queue(first input first output), deque(doyble-ended queue) or stack(last input first output).
To get these data structures
you should use LinkedList's corresponding methods.
If you want to implemenet your own kind of LinkedList then you need to know internal life of LinkedList.
To know more about stack,queue,deque implemented by LinkedList read my tutorial on
Internal Life of LinkedList.