A Generic Design of linked list in C

Linked list is a very important data structure. In C++, with the support of templating, we can implement a template linked likst class and use it for any data type we want. However, in C, there is no such thing like templating. How can we implement a generic linked list? It is tedious to re-implement functions like list_add and list_remove for every data type that needs to be linked. Besides, it is hard to make one node in two lists simultaneously.

Read More

Docker Notes

This post is to archive some commonly used docker commands.

Build

Command

Build an image.

Read More

Git Notes

This post is to archive some commonly used git commands.

Clone

1
2
# Just clone a certain branch from repo and name the local directory as dir
$ git clone -b <branch> <repo> [dir]

Read More

Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Read More