Searching a linked list?
- From: JS <d44sf@xxxxxxxxx>
- Date: Thu, 21 Apr 2005 12:51:26 +0200
I a trying to understand this pseducode:
L = {9,16,4,1}
LIST-SEARCH(L,k)
1 x <- head[L]
2 while x != NIL and key[x] != k
3 do x <- next[x]
4 return x
head[L] points to the head.
In line 1 head[L] gets assigned to x.
Does x equal 9 or 1 (if we assume that the first element in a list starts a
index 1) after this assignment?
.
- Follow-Ups:
- Re: Searching a linked list?
- From: stush
- Re: Searching a linked list?
- From: Randy Poe
- Re: Searching a linked list?
- Prev by Date: Re: FERMAT'S LAST THEOREM
- Next by Date: Re: Searching a linked list?
- Previous by thread: Re: JSH: Surrogate Factoring Fails Completely, What Next?
- Next by thread: Re: Searching a linked list?
- Index(es):
Relevant Pages
|