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
sample i/p: 1 2 5 4 3 6
asc: 1 2 3 4 5 6
o/p: 2 -> Two digits only varies after sorting
sample i/p: 1 4 5 2 3 6
asc: 1 2 3 4 5 6
o/p: 4
#include<stdio.h>
int main() {
@jeevisathya
jeevisathya / infix to prefix.c
Created December 11, 2020 14:49
Stack operation
sample i/p: a+b
o/p: +ab
sample i/p: a+b*c
o/p: +a*bc
#include<stdio.h>
#include <string.h>
#include <ctype.h>
char stack[102];
@jeevisathya
jeevisathya / Infix to postfix.c
Last active December 11, 2020 14:44
Stack operations
sample i/p: x*y+z
o/p: xy*z+
sample i/p: x+y
o/p: xy+
#include<stdio.h>
#include<string.h>
#include<ctype.h>
//infix to postfix expression
sample i/p: 2 2
1 2
3 4
o/p: 1 3
2 4
#include <stdio.h>
#include <stdlib.h>
int mat(int *m, int r, int c){
int i,j;
sample i/p: +44
o/p: 8
sample i/p: ++45
o/p: 9
#include<stdio.h>
#include<string.h>
int stack[20];
int top=-1;
void push(int num){ //Prefix expression
sample i/p: 245+*
o/p: 18
sample i/p: 21+
o/p: 3
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int stack[20];
sample i/p: Hi hello welcome to india
o/p: welcome
#include<stdio.h>
#include<string.h>
int main() {
int i=0,j,y,x,max=0;
char s[102][102];
while(scanf("%s ", s[i])>0){
i++;
#include <stdio.h>
#include<stdlib.h>
struct node{
int data;
struct node* link;
};
struct node* root = NULL;
int len;
void append(void);
int length(void);
sample i/p: 6
o/p:
66666666666
65555555556
65444444456
65433333456
65432223456
65432123456
65432223456
65433333456
sample i/p: 5
o/p:
1 1
12 21
123 321
1234 4321
1234554321
#include<stdio.h>
int main() {