Skip to content

Instantly share code, notes, and snippets.

View vinitshahdeo's full-sized avatar
🚀
Putting "Tech" into FinTech at Novo

Vinit Shahdeo vinitshahdeo

🚀
Putting "Tech" into FinTech at Novo
View GitHub Profile
@vinitshahdeo
vinitshahdeo / delete_bst.cpp
Last active August 1, 2018 09:38
Trees - Data Structures
Node* findMin(Node* root)
{
while(root->left!=NULL)
root=root->left;
return root;
}
Node * deleteNode(Node *root, int x)
{
if(root==NULL)
return root;
@vinitshahdeo
vinitshahdeo / inorder_bst.cpp
Created August 1, 2018 10:19
Inorder Successor - BST
Node * inOrderSuccessor(Node *root, Node *x)
{
if(root==NULL)
return root;
if(x->right)
{
Node* temp=x->right;
while(temp->left!=NULL)
temp=temp->left;
return temp;
@vinitshahdeo
vinitshahdeo / merge_sort.cpp
Last active September 1, 2018 13:21
Sorting Algorithms
/*
Author - Vinit Shahdeo
Check here - https://code.hackerearth.com/ad6725j
*/
#include <iostream>
using namespace std;
void printArray(int a[],int n)
{
for(int i=0;i<n;i++)
cout<<a[i]<<" ";
@vinitshahdeo
vinitshahdeo / NGE.cpp
Last active September 26, 2018 23:42
GeeksForGeeks Important Questions
/*
Author - Vinit Shahdeo
*/
#include<bits/stdc++.h>
using namespace std;
void printNGE(int a[],int n)
{
stack<int> s;
map<int,int> m;
for(int i=0;i<n;i++)
@vinitshahdeo
vinitshahdeo / 3sum.cpp
Created September 14, 2018 21:25
LeetCode Problems
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
set<vector<int> > st;
sort(num.begin(), num.end());
int i, j, k;
int n = num.size();
for (i = 0; i < n - 2; i++) {
j = i+1;
k = n-1;
@vinitshahdeo
vinitshahdeo / 2sum.cpp
Last active September 15, 2018 10:32
LeetCode Problems
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
map<int,int> m;
vector<int> v;
for(int i=0;i<nums.size();i++)
{
if(m.find(target-nums[i])!=m.end())
{
v.push_back(m[target-nums[i]]);
/*
Author - Vinit Shahdeo
Copyright - CodeChef VIT Chapter
*/
#include<bits/stdc++.h>
using namespace std;
bool check(int n)
{
int prev=0;
while(n)
@vinitshahdeo
vinitshahdeo / happybirthday.c
Last active March 3, 2019 09:53
Coder's Way of Saying Happy Birthday
/*
@author vinitshahdeo
*/
#include<stdio.h>
main(){
char str[]="Ibqqz!Cjsuiebz",*p;
p=str;
while(*p!='\0')
--*p++;
printf("%s",str);
@vinitshahdeo
vinitshahdeo / happy_birthday.c
Created March 3, 2019 09:46
Coder's way of wishing Happy Birthday
/*
@author vinitshahdeo
*/
#include <stdio.h>
char *secret = "ziBbeqjAs+cu";
unsigned long message = 10521325414783145265U;
int main(void) {
while (message) {
putchar(secret[message & 15] - 33);
message >>= 4;
@vinitshahdeo
vinitshahdeo / happy_birthday.php
Created March 3, 2019 09:57
Coder's way of wishing happy birthday
/*
@author vinitshahdeo
*/
<?php
$data = base64_decode('SGFwcHkgQmlydGhkYXkh');
echo $data;
?>