这是写给闺女的第一封信

这是写给闺女的第一份信。 妈妈是去年 8 月份怀孕的。那时的爸爸心情还是比较复杂的,既喜悦,也有一些压力。爸爸觉得自己还没有长大,似乎还是个大男孩

Docker Basics

What is Docker? Docker, like git in version control, is the most popular implementation in containerization. Why do we need containers? Because we want consistency in building, running, and shipping applications. In an app, we usually have the code we wrote, third-party dependencies, configuration info, and things about OS(filesystem, networking, etc). With the help of containerization, no matter on which machine, our applications will run in the same environment. Virtual

Implementing Stack and Queue in JavaScript

In JavaScript, both stack and queue data structures are commonly implemented using arrays. Here’s a brief conclusion on how to implement these structures, excluding priority queues which are slightly more complex and typically use third-party libraries. Stack Stacks follow the LIFO principle. Using JavaScript arrays, we can mimic this behavior easily. create a stack 1 const stack = []; push to the top of stack

Leetcode 198.House Robber

Here are two approaches to solving the classic “House Robber” problem: Recursion + Backtracking, and Iteration. Both methods apply dynamic programming effectively, albeit in different ways. Solution One (Recursion + Backtracking) This solution I found online (author: labuladong) uses recursion and backtracking. I am not sure if this counts as dynamic programming. Basic Idea Standing in front of the i-th house, the robber has two options: rob it and jump

Top K Frequent Elements and Heapq in Python

Heapq in Python This module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm. Heaps are binary trees for which every parent node has a value less than or equal to any of its children. This implementation uses arrays for which heap[k] <= heap[2*k+1] and heap[k] <= heap[2*k+2] for all k, counting elements from zero. For the sake of comparison, non-existing elements are considered