algo_019.md (357B)
1 # algo_019 2 3 ### Problem Statement 4 5 > Write an algorithm to count the number of nodes in circular list. 6 7 ## Algorithm 8 ``` 9 procedure count(cl) 10 begin 11 count ← 0; 12 if(cl) 13 ptr ← next(cl); 14 do 15 count ← count + 1; 16 ptr ← next(ptr); 17 while (ptr ≠ next(cl)); 18 endif 19 return(count); 20 end procedure 21 ```