3
Contributors
8
Replies
19
Views
3 Years
Discussion Span
Last Post by jwenting
0

Same as searching any other list. Start with the first entry, use a loop to check each entry to see if it's the one you want.

0

I have no idea what that last post means. I know it's not easy writing in a foreign language, but please try to explain completely.

0

Same as searching any other list. Start with the first element, use a loop to check each element to see if it's the one you want.

0

No. This is not a "we do your homework" site. I will help you to learn how to do it.
Let's suppose your list has a variable for the first element, and each element has a variable for the next element. Then the logic looks like this in pseudo-code:

Element current = list.firstElement
while (current != null)
   test if current is the element you are searching for
      if found, break out of loop
   current = current.next  // go on to next element
end loop
0

might even extend that by starting in the middle and determining what direction to go in, of course only if the list is sorted.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.