Vous êtes sur la page 1sur 5

4/14/13

C, C++, Java, Data Structure, Numerical Analysis Programming: ds - conversion of general tree to binary tree
Share 0

More

Next Blog

C, C++, Java, Data Structure, Numerical Analysis Programming


Microsoft The motley Fool (blog) - Did Microsoft Just Kill the PC Market?

Hi, this is the blog for programs in different programming languages designd by me. the all programs are original and not copied from any where

EliteMatrimony.com
www.e lite m atrim on Ex clusive Matchm ak ing Se rvice From BharatMatrim ony for R ich & Afflue nt

Friday, April 9, 2010

category:
C Graphics (9) C Programming (15) c++ (9) data structure (20) Java programming (2) my stuff (6) Numerical Analysis C Program

ds - conversion of general tree to binary tree


#include"stdio.h" #include"conio.h" #include"alloc.h" #include"stdlib.h" #define n 15 struct node { int data; struct node *lptr; struct node *rptr; }; typedef struct node node; struct stack { int top; int number[n]; struct node *location[n]; }; typedef struct stack stack; void convert(node **); void display(node *); void main() { node *root=NULL; clrscr(); convert(&root); printf("\ndata in binary tree :\n"); display(root); getch(); } void convert(node **root) { char c; int pl,level,x; stack s; node *p=NULL,*ploc=NULL; node *newnode=(node *)malloc(sizeof(node)); s.top=-1; if(newnode==NULL) { printf("memory overflow"); return; } if(*root==NULL) { *root=newnode; (*root)->lptr=(*root)->rptr=NULL; printf("enter level and data>"); scanf("%d%d",&level,&x); (*root)->data=x; s.location[0]=*root; s.number[0]=level; s.top=0; } l:printf("to enter a data(y/n)?"); c=getch(); if(c=='y')

Total Pageviews

19,393

Search This Blog

Popular posts of the week


my stuff women empowerment posters ds - conversion of general tree to binary tree Binomial distribution implementation C Program Of NA Using Euler Method

Blog Arch
October 2

Septembe (4) October 2 July 2010 May 2010

August 20

Slideshow
Loading...

June 2010

April 2010

March 201

There was error in th gadget

About Me

Video Bar

View my c profile

Recent P

pow ered by

amrendraworld.blogspot.in/2010/04/ds-conversion-of-general-tree-to-binary.html

Continuo distributi impleme #include triangula weibull() lognorma uniform() Bernouli distributi impleme void bern {double p;printf(" distributi impleme 1/5

4/14/13

C, C++, Java, Data Structure, Numerical Analysis Programming: ds - conversion of general tree to binary tree
{ printf("\nenter level and data>"); scanf("%d%d",&level,&x); p=(node *)malloc(sizeof(node)); p->lptr=p->rptr=NULL; p->data=x; pl=s.number[s.top]; ploc=s.location[s.top]; if(level>pl) ploc->lptr=p; else { while(pl>level) { s.top=s.top+1; pl=s.number[s.top]; ploc=s.location[s.top]; } ploc->rptr=p; s.top=s.top-1; } s.top=s.top-1; s.number[s.top]=level; s.location[s.top]=p; goto l; }} void display(node *p) { if(p!=NULL) { printf(" %d ",p->data); display(p->lptr); display(p->rptr); } } Posted by AMRENDRA KUMAR at 10:07 AM Labels: data structure No comments: Post a Comment E n t e ry o u rc o m m e n t . . .

Comment as: Google Account Publish Preview

Newer Post
Subscribe to: Post Comments (Atom)

Home

Older Post

impleme success probabil Poisson distributi impleme void pois {int x;dou a;printf(" distributi impleme x & Binomia distributi impleme void bino {int n,x;d p;printf(" distributi impleme C Graph Line clip right bou only usin Lian... #include main(){in x1,y1,x2, xmin,xma u,p,q;int. C Graph Shearing transform void shearing *x,int *y,d shx,doub {double t [3]= {1,0,0,0, a[3][1]= {0,0,1};d c[3][1];in C Graph Scaling i transform void sca *x,int *y,d sx,doubl {double t [3]= {1,0,0,0, a[3][1]= {0,0,1};d c[3][1];in C Graph Rotation transform void rota *x,int *y,d th){doub trans[3][3 {1,0,0,0, a[3][1]= {0,0,1};d c[3][1];in C Graph Translati 2D transform void transalat *x,int *y,i ty){int tra [3]= {1,0,0,0, a[3][1]= {0,0,1};in [1];int... C Graph Flood Fi
2/5

amrendraworld.blogspot.in/2010/04/ds-conversion-of-general-tree-to-binary.html

4/14/13

C, C++, Java, Data Structure, Numerical Analysis Programming: ds - conversion of general tree to binary tree

Flood Fi Function void flood_fill y,int fc,in {    &  in color=ge   &  .. C Graph Ellipse Generati void midpoint xaxis,int yaxis,int {int x=0,y aa=a*a,b aa2=2*a C Graph DDA Lin #include <graph <math. <stdio. <conio dda_line x1,int y1, x2,int y2) C Graph Mid-Poin Circle D #include <stdio. <graph <conio draw_cir main(){in gd=DET r;int... Java Program Calculato swing

amrendraworld.blogspot.in/2010/04/ds-conversion-of-general-tree-to-binary.html

............... java.awt. java.awt. javax.sw class GuiCalcu my stuff welcome amrendr ********** hockey m and me C Progra NA Usin Guass S Method //Gauss method # include <stdio. include <conio include <math. define M 50# defi EPS .000001 main(){.. C Progra NA Usin Method 3/5

4/14/13

C, C++, Java, Data Structure, Numerical Analysis Programming: ds - conversion of general tree to binary tree

Method /*Euler m */# includ <stdio. include <conio main(){ i float x,y,xp,h,d float f(float,flo clrscr();.. C Progra NA Usin Runga-K Mthod O Order /* Runge method o order to 10*dy/dx (y*y)*/# i <stdio. include <conio main(){ i float... C Progra NA Usin Runga-K Method /* Runge method o order */# include <stdio. include <conio main(){ i float x,y0,xp,h float... C Progra NA Usin Simpson Rule /*Simpso rule */# in <stdio. include <conio define M 20void m int j,n=0;

Powered B Blogger P

amrendraworld.blogspot.in/2010/04/ds-conversion-of-general-tree-to-binary.html

4/5

4/14/13

C, C++, Java, Data Structure, Numerical Analysis Programming: ds - conversion of general tree to binary tree

Amrendra kumar, Bit Noida. Travel template. Powered by Blogger.

amrendraworld.blogspot.in/2010/04/ds-conversion-of-general-tree-to-binary.html

5/5

Vous aimerez peut-être aussi