Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Either Optimising or Developing something...

Abhishek Srivastava abhishek2x

💻
Either Optimising or Developing something...
View GitHub Profile
@abhishek2x
abhishek2x / peak.cpp
Created Nov 29, 2020
Finding the peak of an array
View peak.cpp
/*!
* Finding the peak of an array
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
@abhishek2x
abhishek2x / sq.cpp
Last active Dec 19, 2020
Finding Square root using Binary Search Algorithm
View sq.cpp
/*!
* 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.
*/
@abhishek2x
abhishek2x / cnt.cpp
Created Dec 19, 2020
Count how many times a Sorted array is rotated
View cnt.cpp
/*!
* 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)
@abhishek2x
abhishek2x / near.cpp
Created Dec 19, 2020
Searching in Nearly Sorted Array
View near.cpp
/*!
* Copyright (c) 2020 Abhishek Srivastava
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
@abhishek2x
abhishek2x / inf.cpp
Created Dec 19, 2020
Finding a position on an Element in an infinite array
View inf.cpp
/*!
* 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){
@abhishek2x
abhishek2x / binf.cpp
Created Dec 19, 2020
Searching in Bitonic Infinite Array.
View binf.cpp
/*!
* Copyright (c) 2020 Abhishek Srivastava
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
@abhishek2x
abhishek2x / 2d.cpp
Created Dec 19, 2020
Searching in 2-D Array
View 2d.cpp
/*!
* Copyright (c) 2020 Abhishek Srivastava
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
@abhishek2x
abhishek2x / webpack.config.js
Created Feb 5, 2021
Webpack basic configuration
View webpack.config.js
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
};