Increasing fast pointer by 2 only in Floyd cycle finding algorithm -


i going through floyd's cycle finding algorithm , had doubt.

do increase fast pointer 2 only?

is there other value should best match this?

suppose both pointers wind in cycle. relative each other, fast pointer moving 1 unit closer slow pointer on each iteration. means @ point pointers must overlap. handy property.

i suppose 3 speed , 2 speed pointer, wouldn't go faster , code more complex (have write out checks 3 pointers each step instead of 2).


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -