Skip to content

Instantly share code, notes, and snippets.

View gallirohik's full-sized avatar

Rohik Galli gallirohik

View GitHub Profile
@gallirohik
gallirohik / smartDoor.ino
Created August 22, 2018 02:21
IOT project (Smart Door)
void setup() {
// put your setup code here, to run once:
pinMode(4,INPUT);
pinMode(13,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
@gallirohik
gallirohik / phillips.ino
Created August 22, 2018 02:21
IOT project (Phillips hue)
#include<ESP8266WiFi.h>
#include<Adafruit_NeoPixel.h>
#include<ESP8266WebServer.h>
#define SSID "Rohik"
#define SSID_PASSWORD "rohik@999"
Adafruit_NeoPixel strip = Adafruit_NeoPixel(10, 12, NEO_GRB + NEO_KHZ800);
ESP8266WebServer server(80);
@gallirohik
gallirohik / knapSack_dp.cpp
Created August 5, 2018 11:18
knapsack-dp
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<utility>
using namespace std;
int max(int a,int b)
{
return (a>b)? a : b;
@gallirohik
gallirohik / ActSele.cpp
Created August 3, 2018 13:51
task_scheduling
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<utility>
using namespace std;
int getMax(vector<int> &Active)
{
int max=Active[0],pos=0;
@gallirohik
gallirohik / fKnapSack.cpp
Created August 3, 2018 11:03
fractional knapsack problem
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<utility>
#include<iomanip>
using namespace std;
bool myfunction( pair<int,int> a,pair<int,int> b)
@gallirohik
gallirohik / mirrorTree.cpp
Last active August 2, 2018 12:37
Mirror Tree using maps and iterators and pairs
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<utility>
#include<map>
using namespace std;
#include<iostream>
#include "Song.h"
#include<vector>
using namespace std;
class AllSongs{
private:
vector<Song> Songs;
int count;
void setCount(){
count=0;
@gallirohik
gallirohik / AllSongs.cpp
Last active August 8, 2018 09:42
Myproject
#include<iostream>
#include<vector>
#include "AllSongs.h";
#include "Song.h";
using namespace std;
void AllSongs::displaySongs()
{
for(int i=0;i<count;i++)
{
Song s=this->Songs[i];
@gallirohik
gallirohik / AllSongs.h
Created August 1, 2018 13:04
Myproject
#include<iostream>
#include<vector>
#include "Song.h"
using namespace std;
class AllSongs{
private:
vector< Song > Songs;
int count;
void setCount(){
count=0;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void print(vector<vector<int>>mat )
{
int n=mat.size();
for(int i=0;i<n;i++)