Simple Example
list-search(sublistptr, value){
if sublistptr = null or sublistptr.val = value
return sublistptr
return list-search(sublistptr.link, value)}
main(h, value){
x := list-search(h, value)}
Base:
Recursion:
Call stack:
ls(H,x4) <-null
ls(1,x4)-> null 4th
ls(2, x4)-> null 3rd
ls(3,x4)->null 2nd
ls(null, x4)->null 1st
1
2
3
Previous slide
Next slide
Back to first slide
View graphic version