Patrick Wezhi Xu

POJ 3050 Hopscotch

There is a 5 * 5 array filled with integers. You can only go up, down, left and right. You can start on any point in the array and can only move 5 times. Therefore, you will get 6 integers. Find the number of distinct integers you can constructed. Link: Solution I use a set to avoid same sequences. Since there are only 6 steps and the array is only 5*5, dfs each point, add into the set.

POJ 3187 Backward Digits Sums

There are 1 to \(N\) digits (\(1\le N \le 10\)) in certain order. Add adjacent numbers together to get the next line, until the there is only one number left.(Just like Pascal’s triangle) For example, there are 3 integers: $$ 1, 2, 3 $$ $$ 3, 5 $$ $$ 8 $$ So, given \(N\) and the final sum, find the lexicographically least ordering of integers. Link: Notes: Be aware of that the question is asking 1 to \(N\) digits, so we don’t have to test all possible permutations from 1 to 10.

Binary Tree

Binary tree is called so because of its shape. It’s like a tree, it have leaves and a root. In computer science, the “tree” is usually upside down, the root at the top and leaves grow below it. It is binary so it every node only can have 0, 1 or 2 leaves. Terminologies Leaf Node The node do NOT have any child nodes. Inner Node The Node between the leaf node and the root.

Stack, Queue and Linked Lists

Stack, queue and Linked lists are basic data structures. They appear in our daily life. For example, stacks of intermodal containers at the port, waiting in line(queue) to ride a roller coaster and the film The Human Centipede,if you know it. Stack Intro Stack is like a stack of intermodal containers, or a stack of book. Every time you want to put a new item, you put above the original stack, not between or below.

Using Jekyll + Github Pages to build a blog

Why Jekyll and Github Pages Jekyll is an static site generator, it is simple to use with YAML front matter. It is quite convenient to blog with markdown and Jekyll supports it build-in. Github Pages provide the space to host the website for free. Both of them are well-documented, and works well with each other. One thing that makes they works well but not perfect is that although Github Pages can generate the website using Jekyll but as it generates in safe mode, it does not support Jekyll plugin.

The Story About the Blog

PwzXxm is my first blog and also my first website I have ever built. I knew only a little bit of HTML before I started this project. I learned CSS and JavaScript while I’m building the site. I also read a lot of source code and blog posts about how other people build their own site using Jekyll. It took me seven days. Finally, on the 10th of December, 2015, the site went alive.