## GDB useful commands for C-program debugging

To debug a C-program in gdb, compile the program and use the following command to enter into gdb mode in linux terminal – gdb ./your_program…

## Matrix Multiplication

[wpdm_package id=’1153′]

## Bubble Sort on Linked List

[wpdm_package id=’1161′] We have seen sorting on numbers in arrays. Now what about sorting a linked list using bubble sort? Before we continue, we must…

## Appending a Linked List to Another

[wpdm_package id=’1177′] Appending a linked list onto another is pretty easy. All you have to do is, make the last node’s next pointer of the…

## Removing Duplicates from a Sorted Linked List

[wpdm_package id=’1405′] Algorithm: [sourcecode lang=”cpp”] void RemoveDuplicates(intnode* head) { intnode* current = head; if (current == NULL) return; // do nothing if the list is…

## Decimal to Binary Conversion using Stack

[wpdm_package id=’1413′] We had discussed here a few applications of stack. And here is another one. Converting positive decimals to binary using a stack. You…

[wpdm_package id=’1164′] Radix sort by sorting the input numbers on each digit, for each of the digits in the numbers. There are 2 types of…

## Merge Sort

[wpdm_package id=’1181′] A merge sort is based on the classic divide and conquer paradigm. Steps: 1. Divide: Partition the n-element sequence to be sorted into two…

## Quick Sort

[wpdm_package id=’1367′] Quick Sort is one of the fastest sorting algorithms used. Steps: 1. Choose a pivot element. Here, we are choosing the middle element.…

## Check if two Trees are Structurally Similar

[wpdm_package id=’1352′] Algorithm: Use Recursion. If both the trees are NULL, return true. If only one of the trees is NULL return false. Recursively find…