aalhour / C-Sharp-Algorithms

:books: :chart_with_upwards_trend: Plug-and-play class-library project of standard Data Structures and Algorithms in C#
MIT License
5.91k stars 1.4k forks source link

Change recursive function to while loop to save stack space #131

Closed RyanGrange closed 4 years ago

RyanGrange commented 4 years ago

Description

Update for issue 87. Removes need for tail recursion call in FindGCDEuclidean and reduces stack pressure.

Checklist

RyanGrange commented 4 years ago

Sorry. I screwed up. This was supposed to be a separate pull request with the third commit. I'll cancel this and redo them as branches on my end to avoid this mistake.