Who doesn't love pancakes? Pancakes are delicious, sweet, chocolat-y (this depends on your taste), and an application of stack data structure in real life. The top-to-bottom approach is the conventional way to eat pancakes. Plus, you can only apply butter, chocolate, or maple syrup to the top one. This is analogous to the stack data... Continue Reading →
Mini-post: Ensuring The Input Entered is a Number in C
Okay, this is going to be a short one. "How can I be sure the input entered by user is a number in C?" In C++ or Python you can use a try or catch exception, but how about C? I was browsing this topic in Stackoverflow and some guy suggested atoi() or scanf() which will return the numeric value of a letter, but it was complicated (at least... Continue Reading →
Sorting (Doubly) Linked List using Bubble Sort in C
Let's state the obvious first, Bubble Sort is the easiest among sorting algorithms to be implemented. It has O(1) space complexity as it only require one (temporary) additional variable for swapping. The best case time complexity is O(n) when the list is already sorted. The problem with Bubble Sort is its worst time complexity. O(n^2)... Continue Reading →
Linked List Implementation using C
"In their most basic sense, linked list and blockchain are very similar. A node (or block in case of the latter) contains the address (or hash) of the next node." Image source: me + MS Paint My first encounter with linked list was in the 2nd semester of my undergrad study. Since we only use... Continue Reading →