Skip to content

Instantly share code, notes, and snippets.

View jeevisathya's full-sized avatar
🏠
Working from home

Jeevitha S jeevisathya

🏠
Working from home
  • Excelacom technologies
  • chennai
View GitHub Profile
@jeevisathya
jeevisathya / Runlength encoding.c
Created January 14, 2020 15:14
Runlength encoding
#include <stdio.h>
#include <string.h>
int main()
{
int i,j,len,c;
char str[1000];
scanf("%s", str);
for(len=0; str[len] != '\0'; len++);
for(i=0; i<len; i++){
@jeevisathya
jeevisathya / singly linked operations.c
Created January 14, 2020 16:39
singly linked operations
struct node{
int data;
struct node* link;
};
struct node* root = NULL;
int len;
void append(void);
int length(void);
void display(void);
void main()
@jeevisathya
jeevisathya / toggle string.c
Created January 15, 2020 09:06
toggle string
#include <stdio.h>
#include <string.h>
int main()
{
int len1,len2,i,j;
char str1[1000],str2[1000];
scanf("%s\n%s", str1,str2);
for(len1=0; str1[len1] !='\0'; len1++);
for(len2=0; str2[len2] != '\0'; len2++);
for(i=0; i<len2; i++){
@jeevisathya
jeevisathya / stack operations.c
Created January 17, 2020 07:13
stack operations
#define CAPACITY 5
int stack[CAPACITY],top=-1;
void push(int);
int pop();
int isfull(void);
int isempty();
void peek(void);
void Traverse(void);
void main()
{
@jeevisathya
jeevisathya / count of alphabets in alphabetical order.c
Created January 20, 2020 14:28
count of alphabets in alphabetical order
int len,i,j,t,c,k;
char str[1000];
scanf("%s", str);
for(len=0; str[len] != '\0'; len++);
for(i=0; i<len; i++){
for(j=i+1; j<len; j++){
if(str[i] > str[j]){
t=str[i];
str[i]=str[j];
str[j]=t;
#include <stdio.h>
int main(){
int len,i,j,t,c,k;
char str[1000];
scanf("%s", str);
for(len=0; str[len] != '\0'; len++);
for(i=0; i<len; i++){
for(j=i+1; j<len; j++){
if(str[i] > str[j]){
t=str[i];
@jeevisathya
jeevisathya / anagram.c
Created January 20, 2020 15:46
anagram
#include <stdio.h>
int main()
{
int i,j,count,no_count=0,len1,len2,len;
char str1[1000],str2[1000];
scanf("%s\n%s", str1,str2);
for(len1=0; str1[len1] != '\0'; len1++);
for(len2=0; str2[len2] != '\0'; len2++);
if(len1==len2){
len=len1;
@jeevisathya
jeevisathya / maximum char.c
Created January 24, 2020 16:00
maximum char in a string
sample input1:
jeevitha
output:
e
sample input2:
balloon
output:
lo
int main()
{
@jeevisathya
jeevisathya / parenthesis.c
Created January 24, 2020 16:51
balanced or unbalanced parenthesis
sample input1:
{{}{}{}}
sample output:
Balanced
sample input2:
}}{}{}{}
sample output:
Unbalanced
@jeevisathya
jeevisathya / string manipulation.c
Created February 7, 2020 06:37
string manipulation
example1:
i/p:S02E03
o/p:Season 2, Episode 3
example2:
i/p:S10E23
o/p:Season 10, Episode 23
example3:
i/p:S06E60
o/p:Season 6, Episode 60