js-code-to-svg-flowchart
js-code-to-svg-flowchart copied to clipboard
Small issues with the sample (binary search)
First issue is a typo of the algorithm. The line
currentIndex = Math.floor((maxIndex + maxIndex) / 2);
should be with min instead of max:
currentIndex = Math.floor((minIndex + maxIndex) / 2);
Second issue is that the arrow that returns into the while comes from the true branch of the last if statement instead of coming from both branches. It's an obvious mistake for an experienced developer, but it is weird for someone who is learning how to write programs.
Sorry I can't understand. It's mean someone spy hacking me???
First issue is here https://github.com/Bogdan-Lyashenko/js-code-to-svg-flowchart/blob/685509f11e4a736ae31cb6506d92ab13207b09a8/docs/live-editor/index.html#L86 Definitely looks like a typo.
Second Issue
the arrow that returns into the while
@fabian20ro Do you mean this Less-Equal comparator? https://github.com/Bogdan-Lyashenko/js-code-to-svg-flowchart/blob/685509f11e4a736ae31cb6506d92ab13207b09a8/docs/live-editor/index.html#L85 I do not see any issue here, can you elaborate?
@wtho hehe, funny stuff ;) yeah, minIndex + maxIndex obviously