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> | |
using namespace std; | |
void quickSort(int* data, int left, int right); | |
void swap(int* data, int i, int j); | |
int partition(int* data,int left,int right); | |
int main() | |
{ | |
int input[10]={1,6,3,2,5,8,7,0,9,4}; |
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> | |
using namespace std; | |
void countingSort(int* data,int size,int value); | |
int main() | |
{ | |
int input[10]={1,6,5,0,7,2,9,3,4,8}; | |
int size=10,value=9; | |
countingSort(input,size,value); |
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> | |
using namespace std; | |
void heapify(int* data,int size,int i); | |
void heapSort(int* data,int size); | |
void swap(int* data, int i,int j); | |
int main() | |
{ | |
int input[10]={1,0,2,8,3,6,7,9,4,5}; |
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> | |
using namespace std; | |
class min_max | |
{ | |
public: | |
min_max(int min,int max) | |
{ | |
this->min=min; | |
this->max=max; |
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
let MongoClient=require('mongodb').MongoClient; | |
let userName="name"; | |
let userPassword="password"; | |
let serverHost="localhost"; | |
let serverPort=27017; | |
let databaseURL=`mongodb://${userName}:${userPassword}@${serverHost}:${serverPort}`; | |
let databaseName="test"; | |
let databaseCollection="test"; | |
//about to insert data |
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
document.addEventListener('DOMContentLoaded',function(){ | |
for(colorData in color) draw(colorData); | |
}); | |
function draw(data){ | |
let canvas=document.getElementById(data); | |
canvas.height=Config.tile.height; | |
canvas.width=Config.tile.width*color[data].length; | |
let context=canvas.getContext('2d'); | |
for(let i=0;i<=color[data].length-1;i++) |
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<cstdio> | |
using namespace std; | |
void addEdge(int source,int target,int weight); | |
void Floyd(); | |
int w(int source,int target); |
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<cstdio> | |
using namespace std; | |
void addEdge(int source,int target,int weight); | |
void BellmanFord(); | |
int w(int source,int target); |
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> | |
using namespace std; | |
int main(){ | |
//1 2 3 4 | |
//1 2 5 6 | |
int price[4]={1,2,5,6}; | |
int size; | |
//input size and initialize DP table |
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 <stdio.h> | |
void addEdge(int source,int target,int weight); | |
int graph[5][5]={0}; | |
int main() | |
{ | |
//Init | |
int parent[5]; //I'th parent |
OlderNewer