i learn to code in a way where my thought process can be inspected
e.g., u wanna run the code in notes/learncpp_com/ch2_intro_to_fns
edit CMakeLists.txt
in the root directory to add the necessary files, e.g.:
add_executable(ch2_intro_to_fns
notes/learncpp_com/ch2_intro_to_fns/main.cpp
notes/learncpp_com/ch2_intro_to_fns/add.cpp
)
then right click CMakeLists.txt
to add the configuration if it doesn't already exist
day 1, spent hours figuring out how to get c++ intellisense to work on my mac but it wasn't cooperating. at least for now I'll probably won't run my solutions here.
I learned that two pointers are potentially useful when searching for a pair of elements in an array.
solved the "trapping rain water" neetcode which was apparently a "hard". I was thinking about the solution in my head all day and it took only 5 minutes to code out the solution which was not that hard.
haven't updated log in a while but I learned about the slow and fast pointer approach for linked lists, and creating a dummy head is often smart when dealing with deleted heads.
damn, I learned about the tortoise and hare algorithm for linked lists, and how they can be used to detect the start of a cycle. this is used in the find duplicate number problem. I also learned that you can delete a node from a linked list given a reference in o(1) time without needing to search through the list. you simply copy the next into the current and delete next. holy shit
binary trees are cool, mostly intuitive
Different types of DFS: pre-order, in-order, post-order apparently in-order for tree de/serialization is invalid since it doesn't uniquely identify the tree