Augmented Matrix Solution By reducing it to Row Echelon Form in Java

Augmented Matrix Solution By reducing it to Row Echelon Form And then Calculate the result by backward substitution (Code in Java) package echolon;import java.util.Scanner;/** * * @author usman */public class Echolon {     Scanner usman=new Scanner(System.in);    int i,j,k,n,a;    float [][] A=new float[20][20];    float  sum;    float c;    float [] x=new float[10];        public  Echolon(){ Continue reading “Augmented Matrix Solution By reducing it to Row Echelon Form in Java”

GPA Calculator in JAVA

package usman1;import java.util.Scanner;public class Usman1 {public static void main (String args[]){   String grade = “”;  double credit1;  double credit2;  double credit3;  double credit4;  double gradeValue=0;  double totPtsClass1=0;  double totPtsClass2=0;  double totPtsClass3=0;  double totPtsClass4=0;  double totPts=0;  double totalCredits= 0;  double gpa;   Scanner console = new Scanner (System.in);  System.out.println(“Please enter the number of credits ofContinue reading “GPA Calculator in JAVA”

Program to evaluate an expression entered in post-fix form in C++

#include #include #include #include #include const int MAX = 50 ;class postfix{ int stack[MAX] ; int top, nn ; char *s ; public : postfix( ) ; void setexpr ( char *str ) ; void push ( int item ) ; int pop( ) ; void calculate( ) ; void show( ) ;} ;postfix ::Continue reading “Program to evaluate an expression entered in post-fix form in C++”

First Hello World Android Program

Please follow below give steps for create First Hello World Android Program in eclipse :-Step 1:Install  new version of android supported Eclipse Step 2:After install the eclipse go in File Section Step 3:File->new->Android Application Project   Step 4:After click on Android Application project Step 5:Type Application Name,First letter Must be in uppercase Step 6:Click onContinue reading “First Hello World Android Program”

Removing in Bineary Tree

Removing In Bineary Tree All 3 cases: 1st case having no child (leaf node)2nd case having one child (non leaf node)3rd case having two childs 🙂========================================== #include#includeclass treenode{public:int info;treenode *left,*right;treenode(){ this->info=NULL;  this->left=NULL;  this->right=NULL;}treenode(int info){ this->info=info;  this->left=NULL;  this->right=NULL;}void setinfo(int info){ this->info=info; }int getinfo(){ return info; }void setleft(treenode *left){  this->left=left; }void setright(treenode *right){   this->right=right; }treenode *getleft(){ returnContinue reading “Removing in Bineary Tree”

Heap Sort (min heap)

Sorting Using min heap and arrange in decending order  Other Type Of Sorting : Click here :: most important :: #include#include#define max 7class array{int arr[max];int count;public:array(){count=0;for(int i=0;i<max;i++){ arr[i]=0; }}void add(int num){if(count<max){arr[count]=num; count++;}else{cout<<"\n Array is full"<<endl;}}void heapsort(){for(int i=count-1;i>0;i–){int ivalue=arr[i];arr[i]=arr[0];arr[0]=ivalue;makeheap(i);}}void display(){for(int i=0;i<count;i++){ cout<<arr[i]<<"\t";}}void makeheap(int c){for(int i=0;i<c;i++){ int val=arr[i];int s=i;int f=(s-1)/2;while(s>0 && arr[f]>val){ arr[s]=arr[f];s=f;f=(s-1)/2;}arr[s]=val;}}};void main(){clrscr();array a;a.add(15);a.add(19);a.add(18);a.add(7);a.add(17);a.add(16);a.add(8);cout<<"\n\n Values you insert inContinue reading “Heap Sort (min heap)”

Trees in C++

Implementation of Binary Tree …. In-Order TraversalPre-Order TraversalPost-Order Traversal#include#includeclass treenode{public:int info;treenode *left,*right;treenode(){ this->info=NULL;  this->left=NULL;  this->right=NULL;}treenode(int info){ this->info=info;  this->left=NULL;  this->right=NULL;}void setinfo(int info){ this->info=info; }int getinfo(){ return info; }void setleft(treenode *left){  this->left=left; }void setright(treenode *right){   this->right=right; }treenode *getleft(){ return left; }treenode *getright(){  return right; }void insert(treenode *root,int info){treenode *node=new treenode(info);treenode *p,*q;p=q=root;while(info!=p->getinfo() && q!=NULL){p=q;if(info getinfo()){ q=p->getleft(); }else{  q=p->getright(); }}if(info==p->getinfo()){Continue reading “Trees in C++”