Problem 1 was straight-forward, since it's basically the same problem as max-exits-to from the problem bank of this week that I had already solved. However, I adapted it to operate on all nodes of a network, that way we can take care of disconnected components. Going through the 5 step …
Topics: Extras: lists in memory, hashing, simulations, wrap-up Looking at lists, and how they’re actually implemented in memory. Looking at dictionaries, and how they are implemented in memory using hash tables. Going over simulations. Simulations Topic useful for many domains Computationally describe the world using randomness One very important …
Topics: Visualization Library Plots help us visualize data. I sped through the video because it didn’t seem useful to me. I don’t see myself using the plot library anytime soon. And if I do, I’ll just read the documentation and examples on stack overflow or something to …
It was a little harder than expected. Took about 2.22 hours, got tripped up a bit on extract_end_bits and reveal_image scaling parts. Here is my code: https://github.com/miguelHx/intro-to-cs-mit-problem-sets/blob/main/1_ps5/ps5.py There was an easier way to do the extract end bits on google …
Topics: String and List Examples, Analyzing Complexity, Search: indirection, linear search, bisection search This lecture we are looking at more code and analyzing their complexities. Be careful what the inputs are and whether or not they contribute to the complexity. Went over a bunch of examples, it was a good …
Topics: Sort: bogo, bubble, selection, merge sort Linear search vs. Binary search on a sorted list. Going through examples.
Graphs Module Many forms of information naturally organize themselves into trees of various kinds. But what about transit maps, wiring diagrams, the world wide web or even secret underground passages. Most of these have one or two key properties that make them be graphs instead of trees. One property is …
Topics: Complexity: measuring efficiency, timing programs, counting operations Efficiency is important. Separate time and space efficiency of a program Tradeoff between them: can use a bit more memory to store values for quicker lookup later Think fibonacci recursive vs. fibonacci with memoization Challenges in understanding efficiency A program can be …
Topics: Complexity: Big-Oh notation, Big-Theta notation, complexity relations and classes, calc-complexity Getting introduced to the python time.perf_counter() function. This is new to me. I guess its a more accurate version of time.time(). We compare the runtime of a few different functions. The plots of input size vs. runtime …
Finished the problem set in about 2.6 hours. It was a good exercise. Github link to my solution: https://github.com/miguelHx/intro-to-cs-mit-problem-sets/tree/main/1_ps4