The Gateway to Computer Science Excellence
0 votes
13 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 Boss (41.9k points) | 13 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
50,647 questions
56,492 answers
195,439 comments
100,711 users