Skip to content

Instantly share code, notes, and snippets.

View ravikiran0606's full-sized avatar
🎯
Focusing

Ravi Kiran Selvam ravikiran0606

🎯
Focusing
View GitHub Profile
https://github.com/ravikiran0606/FoodWasteManagement/invitations
@ravikiran0606
ravikiran0606 / tcget.py
Created March 19, 2017 07:52 — forked from cou929/tcget.py
Fetch TopCoder problem statement, test cases and expected result of system test. And save these data to file.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
tcget.py
Kosei Moriyama <cou929@gmail.com>
'''
import BeautifulSoup
@ravikiran0606
ravikiran0606 / mst.cpp
Created September 25, 2016 15:41
Minimum Spanning Tree : ( Using Prim's Algorithm and Krushall's Algorithm )
#include<bits/stdc++.h>
using namespace std;
vector<int>d,parent,mark;
vector< pair<int,int> >edges;
map< pair<int,int> ,int>weight;
vector< vector< pair<int,int> > >graph;
void prim(int s,int n){
@ravikiran0606
ravikiran0606 / SP in Weighted Graph.cpp
Created September 25, 2016 15:02
Shortest Path in Weighted Graph : (Using Dijkstra)
#include<bits/stdc++.h>
using namespace std;
vector<int>d;
vector< vector< pair<int,int> > >graph;
vector<bool>mark;
void dijkstra(int s,int n){
int u,i;
@ravikiran0606
ravikiran0606 / SP in Unweighted Graph.cpp
Last active January 3, 2021 20:18
Shortest Path in Unweighted Graph : ( Using BFS )
#include<bits/stdc++.h>
using namespace std;
vector< vector<int> >graph;
vector<int>d;
vector<bool>vis;
void bfs(int s){
int t;
@ravikiran0606
ravikiran0606 / graphsearch.cpp
Last active September 25, 2016 15:16
Graph Traversals: DFS (Depth First Search) and BFS (Breadth First Search)
#include<bits/stdc++.h>
using namespace std;
vector< vector<int> >graph;
vector<bool>vis;
void dfs(int s){
vis[s]=true;
cout<<s<<" ";
@ravikiran0606
ravikiran0606 / DFS.cpp
Created September 25, 2016 14:00
Graph Traversal : DFS (Depth First Search)
#include<bits/stdc++.h>
using namespace std;
vector< vector<int> >graph;
vector<bool>vis;
void dfsvisit(int s){
vis[s]=true;
cout<<s<<" ";
@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;