Skip to content

Instantly share code, notes, and snippets.

View gallirohik's full-sized avatar

Rohik Galli gallirohik

View GitHub Profile
@gallirohik
gallirohik / getNumberYear.py
Created December 16, 2017 09:20
get number of students in yearwise
def getYear(srkrData):
years={}
for s in srkrData:
year=s.split("\t")[2];
if(years.has_key(year)==True):
yearCount=years[year]
yearCount=yearCount+1
years[year]=yearCount;
else:
years[year]=1
@gallirohik
gallirohik / getReverse.c
Created February 21, 2018 19:04
get reverse of words
#include <stdio.h>
int length(char *str)
{
int i=0;
while(*str!='\0')
{
i++;
str++;
}
return i;
@gallirohik
gallirohik / missednumber.c
Created February 25, 2018 17:43
Missed number in an array
#include <stdio.h>
#include <stdlib.h>
int lsearch(int *arr,int length)
{
int i;
for(i=0;i<length;i++)
if(arr[i]==0)return i+1;
}
int main()
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *arr=(int *)malloc(20*sizeof(int)),count[3]={0},n,i,j;
printf("enter n:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
@gallirohik
gallirohik / getMax.c
Created February 25, 2018 18:52
get Maximum sum
#include <stdio.h>
#include <stdlib.h>
int main()
{
int arr[50],i,n,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
@gallirohik
gallirohik / navbar.html
Created February 26, 2018 10:18
navigation bar
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
@gallirohik
gallirohik / rRotateByD.c
Created February 26, 2018 18:17
rotate array towards right by d positions
#include <stdio.h>
#include <stdlib.h>
void reverse(int *arr,int start,int end)
{
int temp,i,j;
for(i=start,j=end;i<j;i++,j--)
{
temp=arr[i];
arr[i]=arr[j];
@gallirohik
gallirohik / qSort.c
Created February 28, 2018 17:35
quick sort
#include <stdio.h>
#include <stdlib.h>
int partition(int *arr,int low,int high)
{
int j,pivot,i,temp;
pivot=arr[low];
i=low+1;
j=high-1;
do{
while(arr[i]<pivot)i++;
@gallirohik
gallirohik / alive.c
Created February 28, 2018 18:59
who is alive
#include <stdio.h>
#include <stdlib.h>
int who_alive(int n,int k)
{
unsigned int mask=0x01,i=1,alived;
mask=mask<<7;
n=n<<k;
while((n&mask)==0)
{
mask=mask>>1;
@gallirohik
gallirohik / index.php
Last active March 8, 2018 09:45
index page
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>