Posts

Showing posts with the label programming

Insertion Sort algorithm explained in python with example

Image
Insertion sort is an algorithm for sorting a list of numbers. The key idea of this algorithm is to divide the list into two portions: a sorted portion and an unsorted portion. At each step of the algorithm a number is moved from the unsorted portion to the sorted portion until the entire list is sorted. Make sure you watch the video tutorial given at the end to understand how the code is written. Insertion sort implemented in python: Read more »

Writing a C/C++ program on ubuntu terminal

Image
Here is a simple 5 step instruction to compile and execute C/C++ program on the linux terminal. I have also included a sample C/C++ example to demonstrate. In order to write the program in the terminal itself, we need a console  (terminal)  based  text editor so,  I am using Vim in this tutorial since vim is the most popular console text editor, but  you are free to write your program in any editor like nano,  pico, jed  or  vim etc. Now, lets follow the instructions but it would be really helpful if you learn some vim basics here  (won't take much time)  before proceeding to the instructions or its perfectly okay if you are in a hurry :) Read more »