about summary refs log tree commit diff
path: root/scratch/data_structures_and_algorithms
AgeCommit message (Collapse)AuthorFilesLines
2020-07-01 Impl part 3/3 for MemoWilliam Carroll1-29/+10
Refactor the caching policy for the Memo by evicting the elements that have been the least-recently-accessed. Python's heapq module default to a min-heap. By storing our heap elements as (UnixTime, a), we can guarantee that when we call heappop, we will get the element with the lowest UnixTime value in heap (i.e. the oldest). When we call heappush, we use (time.time(), key) and these values -- by having the largest UnixTime, will propogate to the bottom of the min-heap.
2020-07-01 Support part 2/3 for the Memo problemWilliam Carroll1-4/+64
Bound the size of the memo by creating a BoundedQueue. Whenever we add elements to the BoundedQueue, we remove the oldest elements. We use the BoundedQueue to control the size of our dictionary that we're using to store our key-value pairs.
2020-07-01 Implement part 1/3 for "Memo"William Carroll1-0/+19
After hearing from a Jane Street recruiter, I decided to dust off some of the DS&As knowledge. I found this article online, which outlines an example problem called "Memo": https://blog.janestreet.com/what-a-jane-street-dev-interview-is-like/ Here's part 1 of the solution in Python.
2020-02-12 Tidy up structure of briefcaseWilliam Carroll52-0/+3737
I had a spare fifteen minutes and decided that I should tidy up my monorepo. The work of tidying up is not finished; this is a small step in the right direction. TL;DR - Created a tools directory - Created a scratch directory (see README.md for more information) - Added README.md to third_party - Renamed delete_dotfile_symlinks -> symlinkManager - Packaged symlinkManager as an executable symlink-mgr using buildGo