This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <conio.h> | |
#include <queue> | |
#include <stack> | |
#define INFINITY 10000 | |
#define WHITE 0 // Not discovered | |
#define GREY 1 // Discovered | |
#define BLACK 2 // Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <time.h> | |
#define INFINITY 100000.0 | |
using namespace std; | |
class PSOTestFunction | |
{ | |
public: | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Heap Sort | |
Author: Gaurav Sharma | |
Date: 26-04-19 15:02 | |
Description: A simple c++ program to sort an array using heap sort algorithm with the help of max-heap data structure. | |
Here the indexing starts from 0. | |
*/ | |
#include <iostream> | |
#include <math.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Count Sort | |
Author: Gaurav Sharma | |
Date: 26-04-19 17:19 | |
Description: A simple c++ program to sort an array using count sort algorithm. If range is linear with array size than this | |
algorithm runs in linear time. | |
*/ | |
#include <iostream> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Subset problem | |
Author: Gaurav Sharma | |
Date: 27-04-19 16:57 | |
Description: A simple c++ program to find a subset from a set of positive numbers whose combined sum is exactly equal to | |
given sum using DP. Here subsetSum() calculates a DP table, displayTable displays the table and getSubset prints the | |
subset if exists using bracktracking. | |
*/ | |
#include <iostream> | |
#include <conio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: RED BLACK TREE | |
Author: Gaurav Sharma | |
Date: 28-04-19 19:09 | |
Description: A simple c++ program to create a red black tree with insert and delete operations. | |
*/ | |
#include <iostream> | |
#include <conio.h> | |
#define RED 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Bubble Sort | |
Author: Gaurav Sharma | |
Date: 28-04-19 17:29 | |
Description: A simple c++ program to sort an array using bubble sort algorithm. | |
*/ | |
#include <iostream> | |
#include <conio.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Insertion Sort | |
Author: Gaurav Sharma | |
Date: 26-04-19 17:31 | |
Description: A simple c++ program to sort an array using insertion sort algorithm. | |
*/ | |
#include <iostream> | |
#include <conio.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Selection Sort | |
Author: Gaurav Sharma | |
Date: 26-04-19 17:35 | |
Description: A simple c++ program to sort an array using Selection sort algorithm. | |
*/ | |
#include <iostream> | |
#include <conio.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Quick Sort | |
Author: Gaurav Sharma | |
Date: 27-04-19 18:01 | |
Description: A simple c++ program to sort an array using Quick sort algorithm. | |
*/ | |
#include <iostream> | |
#include <conio.h> | |
#include <time.h> |
OlderNewer