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
Node* findMin(Node* root) | |
{ | |
while(root->left!=NULL) | |
root=root->left; | |
return root; | |
} | |
Node * deleteNode(Node *root, int x) | |
{ | |
if(root==NULL) | |
return root; |
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
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; |
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
/* | |
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]<<" "; |
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
/* | |
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++) |
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
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; |
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
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]]); |
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
/* | |
Author - Vinit Shahdeo | |
Copyright - CodeChef VIT Chapter | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; | |
bool check(int n) | |
{ | |
int prev=0; | |
while(n) |
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
/* | |
@author vinitshahdeo | |
*/ | |
#include<stdio.h> | |
main(){ | |
char str[]="Ibqqz!Cjsuiebz",*p; | |
p=str; | |
while(*p!='\0') | |
--*p++; | |
printf("%s",str); |
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
/* | |
@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; |
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
/* | |
@author vinitshahdeo | |
*/ | |
<?php | |
$data = base64_decode('SGFwcHkgQmlydGhkYXkh'); | |
echo $data; | |
?> |
OlderNewer