CLRS icon indicating copy to clipboard operation
CLRS copied to clipboard

10.2-4 need to consider x equals to L.nil

Open funny1dog opened this issue 3 years ago • 0 comments

The last line of code: return x which is not considered if x == L.nil, and then it returns L.nil with L.nil.key = k, and how does the return value differentiate it from the normally found elements?

So we need to check if x == L.nil and if it is then set L.nil.key = NIL to solve the issue.

funny1dog avatar Nov 17 '22 00:11 funny1dog