Heap sort algorithm

sorting algorithm

Heap sort algorithm Heap sort was invented by John Williams. Heap is a complete binary tree in which every parent node be either greater or lesser than its child nodes. Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element … Read more

Quick Sort Algorithm

sorting algorithm

Quick Sort Algorithm There are may versions of Quick sort, which is one of the most popular sorting methods due to its speed (O(N lgN) average, but O(N^2) worst case). Here’s the steps to follow: Pick a “pivot” item Partition the other items by adding them to a “less than pivot” sublist, or “greater than … Read more

Merge Sort Algorithm

Merge Sort Algorithm Merge Sort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges … Read more

Matrix multiplication program in C

c program for two-dimensional arrays

Matrix multiplication program in C Matrix multiplication in C language to calculate the product of two matrices (two-dimensional arrays). A user inputs the orders and elements of the matrices. If the multiplication isn’t possible, an error message is displayed. You may have studied the method to multiply matrices in Mathematics. Matrix multiplication in C language … Read more

C Program to Check whether an Alphabet is Vowel or Consonant

c program to check vowel and consonant

C Program to Check whether an Alphabet is Vowel or Consonant This program takes the character value(entered by user) as input and checks whether that character is a vowel or consonant using if-else statement. Since a user is allowed to enter an alphabet in lowercase and uppercase, the program checks for both uppercase and lowercase … Read more

IP Address Program in C

IP address program in c

IP Address Program in C What is IP Address An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication.   Let’s Start Writting C program to find IP Address.   #include<stdlib.h> main() { system(“C:\\Windows\\System32\\ipconfig”); system(“pause”); return 0; }  

Merry Christmas – Program for Christmas Tree in C

merry christmas program in c

Merry Christmas – Program for Christmas Tree in C   To print a Christmas tree, we are printing pyramids of various sizes just one beneath the other. For the decoration, a random character is printed at each position. Height and randomness can be adjusted. This is been repeated frame after frame to give the illusion of a true event. … Read more

C Program to Add two numbers

c program to add 2 numbers

C Program to Add two numbers Program to add two integer numbers To read the input numbers we are using scanf() function and then we are using printf() function to display the sum of these numbers. The %d used in scanf() and printf() functions is the format specifier which is used for int data types in C programming. … Read more

How to Write and Run a C Program in Ubuntu

write a cprogran in ubuntu

How to Write and Run a C Program in Ubuntu Linux is becoming a programming heaven for developers. This is an open source and free operating system. Turbo C compiler is already an old approach to compile programs so let us programmers move to Linux for a new programming environment. Step 1: Install the build-essential … Read more