The Gateway to Computer Science Excellence
0 votes
35 views
LIST-SEARCH’(L, k)
1     x = L.nil.next
2     while x != L.nil and x.key != k
3     x = x.next
4     return x

As written, each loop iteration in the LIST-SEARCH’ procedure requires two tests: one for $x\neq L.nil$ and one for $x.key\neq k$. Show how to eliminate the test for $x\neq L.nil$ in each iteration.

in Algorithms by | 35 views

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,315 questions
60,436 answers
201,775 comments
95,253 users