DSA

C Program for Addition of two Sparse Matrices

#include<stdio.h> #include<stdlib.h> #define MAX 20 void printsparse(int b[MAX][3]); void readsparse(int b[MAX][3]); void addsparse(int b1[MAX][3],int b2[MAX][3],int b3[MAX][3]); void main() {     int b1[MAX][3],b2[MAX][3],b3[MAX][3];     readsparse(b1);     readsparse(b2);     addsparse(b1,b2,b3);     printsparse(b3); } void readsparse(int b[MAX][3]) {     int i,t,m,n;     printf(“nEnter no. of rows and columns:”);     scanf(“%d%d”,&m,&n);     printf(“No. of non-zero triples:”);     scanf(“%d”,&t);     …

C Program for Addition of two Sparse Matrices Read More »

Infix to Postfix Conversion in C [Program and Algorithm]

In this tutorial you will learn about program and algorithm for infix to postfix conversion in C with an example. In infix notation or expression operators are written in between the operands while in postfix notation every operator follows all of its operands.   Example: Infix Expression: 5+3*2 Postfix Expression: 5 3 2*+.   Infix …

Infix to Postfix Conversion in C [Program and Algorithm] Read More »

Evaluation of Postfix Expression in C [Algorithm and Program]

Here you will get algorithm and program for evolution of postfix expression in C. In postfix or reverse polish notation, every operator follows all of its operands. For example: 5 3 2 * + Also Read: Infix to Postfix Conversion in C [Program and Algorithm]   Algorithm for Evaluation of Postfix Expression Create an empty stack and …

Evaluation of Postfix Expression in C [Algorithm and Program] Read More »