Basic implementations of popular algorithms for quick self refresh before interviews.
Please do not use these algorithm implementations for production code as is. The implementations are deliberately not always optimal and do not cover all corner cases.