Skip to content

Instantly share code, notes, and snippets.

View Shravan40's full-sized avatar

Shravan Kumar Gond Shravan40

View GitHub Profile
/*
Author @ mama
Date : 19/10/2013
Prob : https://www.hackerrank.com/contests/oct13/challenges/angry-children-2
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
// http://www.codechef.com/NOV13/problems/MCHAIRS/
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int t;
cin>>t;
@Shravan40
Shravan40 / Eratosthenes.cpp
Last active December 27, 2015 21:19
Implementation of Seive Eratosthenes ( Prime number generator up to give value of n ). https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
// Implementation of Seive Eratosthenes ( Prime number genrator upto n;
// https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
// Autohr @ Shravan40/mama
// Place : Kharagpur, India
// Date : 10/11/2013
#include <iostream>
#include <vector>
#include <cmath>
@Shravan40
Shravan40 / seive_of_atkin.cpp
Created November 12, 2013 06:43
Implementation of Seive of Atkin ( http://en.wikipedia.org/wiki/Sieve_of_Atkin ) in C++.
// Author @ Shravan40/mama
// Date : 12/11/2013
// Title : Seive of Atkin ( Prime number Generator)
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
//***************************************************************
// HEADER FILE USED IN PROJECT
//****************************************************************
#include<iostream>
#include<fstream>
#include<cctype>
#include<iomanip>
using namespace std;
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* newNode(int num)
@Shravan40
Shravan40 / reverse_string.cpp
Created December 12, 2013 18:20
Program to Reverse a string
// Program to reverse the string
// Author @ shravan40/mama
#include<iostream>
#include<string>
using namespace std;
int main()
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
@Shravan40
Shravan40 / semi_sort.cpp
Created January 27, 2014 23:29
Given an array of numbers and the size of array. Wrtite a program to arrange all the negative numbers at the beginning followed by positive numbers..(Note : The order of elements should be the same as in the input) ex : i/p : -3 4 2 1 -8 6 -5 o/p: -3 -8 -5 4 2 1 6 conditions: should be done in O(n) and without using extra space.
#include<iostream>
#include<vector>
using namespace std;
int main()
{
cout<<"Enter the number of element in sequence : ";
int n;
cin>>n;
vector<int> data;
int temp;