Skip to content

Instantly share code, notes, and snippets.

View ravikiran0606's full-sized avatar
🎯
Focusing

Ravi Kiran Selvam ravikiran0606

🎯
Focusing
View GitHub Profile
@ravikiran0606
ravikiran0606 / Segment.cpp
Created September 7, 2016 01:54 — forked from aajjbb/Segment.cpp
Segment Tree for Range Minimum Query
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <memory>
@ravikiran0606
ravikiran0606 / ExpressionValidation.cpp
Created August 21, 2016 08:50
C++ Program to check whether the given expression is valid or not:
#include<iostream>
#define maxi 1000
using namespace std;
template<class T>
class sstack{
T a[maxi];
int top;
@ravikiran0606
ravikiran0606 / dualstack.cpp
Created August 21, 2016 08:47
C++ Program to implement two stacks in a single array :
#include<iostream>
#define maxi 10
using namespace std;
template<class T>
class dualstack{
T a[maxi];
int top1,top2;
@ravikiran0606
ravikiran0606 / stlmap.cpp
Created August 21, 2016 08:45
C++ Program to implement the use of STL Map:
#include<iostream>
#include<map>
// Used to store key value pairs. (Eg: To maintain Phone Book )
using namespace std;
int main()
{
map<string,long long>phonebook;
@ravikiran0606
ravikiran0606 / stlvector.cpp
Created August 21, 2016 08:43
C++ Program to implement the use of STL vector :
#include<iostream>
#include<vector>
// Similar to array but useful when the number of elements (size) is unknown...
using namespace std;
int main()
{
vector<int>v;
@ravikiran0606
ravikiran0606 / Virtualfunctions.cpp
Created July 31, 2016 10:41
C++ program to implement the use of Virtual functions and Pure Virtual functions:
#include<iostream>
using namespace std;
class media{ // Abstract Class...
protected:
string bookname,authorname,authornativelang;
int bookISBN;
public:
virtual void display(); // Virtual function...
@ravikiran0606
ravikiran0606 / NestedClass.cpp
Last active July 31, 2016 09:12
C++ program to implement the initialization of Nested Members in a class:
#include<iostream>
using namespace std;
class first{
int fa,fb;
public:
first();
first(int x,int y);
@ravikiran0606
ravikiran0606 / TypeConversion.cpp
Last active July 31, 2016 08:51
C++ Program to implement the Type Conversion in Classes:
#include<iostream>
using namespace std;
class duration{
int mi;
public:
duration();
duration(int t);
@ravikiran0606
ravikiran0606 / Arrayofobj.cpp
Last active July 31, 2016 08:48
C++ program to implement the array of objects and pointer pointing to it:
#include<iostream>
#include<string>
using namespace std;
class student{
string name;
int rollno;
public:
#include<iostream>
#define maxi 100
using namespace std;
int flag;
float add(float a,float b){
return (a+b);
}