What the heck is sleep sort anyway? Computer science students are probably familiar with terms quick sort, merge sort, insertion sort, and the simplest of them all, bubble sort. But a new player has joined the game; his name is sleep sort. Dubbed as "King of Laziness", it became popular after a post on 4Chan's... Continue Reading →
Mini-post: Polynomial Regression Model Using NumPy
This is my first time using the Seaborn module in Python, and I have to admit I'm quite mesmerized by the hue feature when plotting. It just seems so beautiful; far from the regular matplotlib scatterplot I have been using. So let's say we're given the below scatterplot, how do we find out the model... Continue Reading →
Pancakes and Arrays, How to Implement Stack Data Structure using C
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 →
Basic Calculus with Python: Differentiation and Integration
I have to admit, I'm really excited whenever I googled "How to do <something> in python" and a Stackoverflow link--with a (solved) tag-- come on top of the result page. Star of today's show is the sympy module: a library aimed at solving and displaying symbolic computation. What is symbolic computation? Ever had one of... 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 →
Simulating Keyboard Strokes Using Python
As part of the Data Structures course in university, we were assigned a task to create a record system using doubly linked list. Everything went well: I planned the project, read the book for references, and finally started coding --until-- I had to manually test the program myself. I programmed in XCode, which didn't provide... 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 →