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
struct DisjointSet { | |
vector<int> parent; | |
vector<int> size; | |
DisjointSet(int maxSize) { | |
parent.resize(maxSize); | |
size.resize(maxSize); | |
for (int i = 0; i < maxSize; i++) { | |
parent[i] = i; | |
size[i] = 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
const path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js', | |
}, | |
}; |
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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int main(){ |
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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int main(){ |
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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int binaryPlay(vector<int> a, int l, int h, int key){ | |
while(l<=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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int main(){ |
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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int countRotations(int arr[], int low, int high) |
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
/*! | |
* Copyright (c) 2020 Abhishek Srivastava | |
*/ | |
/* | |
For demstration of concept we are using | |
int variable. But ideally we will prefer using | |
double value with an Epison error estimation. | |
*/ |
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
/*! | |
* Finding the peak of an array | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int main(){ |
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
/*! | |
* Finding Ceil of an Element in a Sorted array | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; | |
#define ll long long int | |
int main(){ |
NewerOlder