pretoin.h

来自「This source code is used for make infix 」· C头文件 代码 · 共 29 行

H
29
字号
#include <stdio.h>  /*For formated input output like fprintf and fscanf*/#include <string.h> /*For formated string like strcpy and strcmp*/#include <stdlib.h> /*For dynamic memory allocation like free and malloc*//*This struct is use for tree node *This struct keep data information and left and right child */typedef struct tree_node* tree_ptr;struct tree_node {		char data; /*1,2,3,4,5,6,7,8,9,0 or + - ,*, / */	tree_ptr leftChildPtr;	tree_ptr rightChildPtr;	}tree_node;/*It start the process of program*/void process(); /*Make a tree node get node data and set left and right child null and return new tree_ptr*/tree_ptr get_node( char data );/*get the evaluation string from stdin and return string lenght*/int getEvaluation( char **evaluation );/*This function is extern that make tree for all char in evaluation*/extern void create_tree( tree_ptr *top , char *evaluation , int evaluationLength );/*Walk on tree inorder traversal and find infix notation put it expressino*/extern void inorder( tree_ptr ptr , char *expression );/*Walk on tree and find the result and return it.Result is float type*/extern float calculate( tree_ptr node ); 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?