Skip to content

Instantly share code, notes, and snippets.

View vishwesh07's full-sized avatar

Vishwesh Patel vishwesh07

View GitHub Profile
@alexbowe
alexbowe / tree_iterators.py
Last active July 5, 2023 23:41
Method to simplify many programming interview tree questions.
'''
Interview hack: Memorize preorder/inorder/postorder tree ITERATORS (no recursion) and their reverses.
It simplifies a disproportionate number of questions to simple for loops (see below).
I consider the implementations below the simplest way to memorize the iterative tree traversal algorithms,
because they are so similar to each other, and to their respective recursive versions.
Notes:
- We only visit a node after we have expanded its children (i.e. added them to the stack) in the desired order.
- `x is curr` does the expanded flagging for us, because we always expand the current node.
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active October 13, 2025 20:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@hofmannsven
hofmannsven / README.md
Last active October 2, 2025 20:17
Git CLI Cheatsheet