Skip to content

Instantly share code, notes, and snippets.

View AjayKrP's full-sized avatar

Ajay Kumar AjayKrP

View GitHub Profile
#include <limits.h>
#include <iostream>
#define V 10
using namespace std;
int minCost = 0;
int minKey(int key[], bool mstSet[], int n) {
int min = INT_MAX, min_index = -1;
for (int v = 0; v < n; v++)
if (!mstSet[v] && key[v] < min)
#include <iostream>
#define MAX_VALUE 65536
using namespace std;
class Node
{
public:
int key;
Node *left, *right;
bool leftThread, rightThread;
};
#include<iostream>
#include<queue>
#include<stack>
using namespace std;
class graph{
public:
graph(){
for(int i=0;i<10;++i){
#include <windows.h>
#include <gl/Gl.h>
#include <gl/glut.h>
#include <cmath>
int screenheight = 600;
int screenwidth = 800;
bool flag = true;
int first = 0;
#include <GL/glut.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int x1,x2,y1,y2;
float gap;
void display(void)
{
int DelX,DelY,Max;
int n=0,Total=1,j=0;
#include <stdio.h>
#include <math.h>
#include <GL/glut.h>
// Center of the cicle = (320, 240)
int xc = 320, yc = 240;
// Plot eight points using circle's symmetrical property
void plot_point(int x, int y)
{
<html>
<head>
<!-- LikeBtn.com BEGIN -->
<span class="likebtn-wrapper" data-identifier="item_1"></span>
<script>(function(d,e,s){if(d.getElementById("likebtn_wjs"))return;a=d.createElement(e);m=d.getElementsByTagName(e)[0];a.async=1;a.id="likebtn_wjs";a.src=s;m.parentNode.insertBefore(a, m)})(document,"script","//w.likebtn.com/js/w/widget.js");</script>
<!-- LikeBtn.com END -->
<div id="disqus_thread"></div>
<script>
#include<iostream>
#include<queue>
#define NULL __null
class SimpleTree{
public:
SimpleTree* createNode(const int& data);//return adderss of newly inserted data
void insertNode(SimpleTree** root, const int& data);//SimpleTree** root, keep track of root
void printDFS(SimpleTree* root); // for DFS
void printBFS(SimpleTree* root); // for BFS
#include <stdio.h>
#include <math.h>
#include <GL/glut.h>
#include<iostream>
#define PI 3.14159
// Center of the cicle = (320, 240)
int xc = 320, yc = 240;
// Plot eight points using circle's symmetrical property
float round_value(float v)
#include <iostream>
#include <math.h>
#include <GL/glut.h>
double X1, Y1, X2, Y2;
const double D = 50;
float round_value(float v)
{
return floor(v + 0.5);