1.[问题描述] 编写递归算法,计算二叉树中叶子结点的数目 [输入] 按照先序序列的顺序输入该结点的内容。其输入abd eh cf i g . [输出] 按中序序列输出,输出的结果为;dbheaficg并计算出二叉树中叶子结点的数目为4 [存储结构] 采用二叉表存储 [算法的基本思想] 采用递归方法建立和遍历二叉树。首先建立二叉树的根结点,然后建立其左右子树,直到空子树为止,中序遍历二叉树时,先遍厉左子树,后遍厉右子树,最后访问根结点。根据左右子树的最后一个结点计算出二叉树中叶子结点的数目。 程序如下: #include<stdio.h> #include<malloc.h> #include"stdlib.h"
上传时间: 2015-11-16
上传用户:GavinNeko
2.[问题描述] 编写递归算法,在二叉树中求位于先序序列中第K个位置的结点 [输入] 按照先序序列的顺序输入该结点的内容。其输入abd eh cf i g 。输入要求的位置 [输出] 若二叉树不空,按先序序列输出,求出所求位置的结点 [存储结构] 采用二叉表存储 [算法的基本思想] 采用递归方法建立和遍历二叉树。首先建立二叉树的根结点,然后建立其左右子树,直到空子树为止,先序遍历二叉树时,先遍厉左子树,后遍厉右子树,最后访问根结点并计算出二叉树中叶子结点的数目和第K个位置的结点 #include<stdio.h> #include<malloc.h> struct node{ char info struct node*llink,*rlink } typedef struct node NODE
上传时间: 2014-01-13
上传用户:zm7516678
[问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N) [输入] 待排序记录个数,各关键字的值。 [输出] 关键字从正负分开,正数在前 [存储结构] 待排序记录顺序存储。 [算法的基本思想] 快速排序算法每次任取一个记录的关键字为标准,将其余记录分为两组将,N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前。 #include <iostream> using namespace std #define MAXNUM 100//设文件的最长可能长度 void sort(int* keys, const int len)//排序
上传时间: 2014-01-13
上传用户:aig85
Software Testing, Second Edition provides practical insight into the world of software testing and quality assurance. Learn how to find problems in any computer program, how to plan an effective test approach and how to tell when software is ready for release. Updated from the previous edition in 2000 to include a chapter that specifically deals with testing software for security bugs, the processes and techniques used throughout the book are timeless. This book is an excellent investment if you want to better understand what your Software Test team does or you want to write better software.
标签: practical Software provides software
上传时间: 2014-08-01
上传用户:zhaiyanzhong
The ability to write efficient, high-speed arithmetic routines ultimately depends upon your knowledge of the elements of arithmetic as they exist on a computer. That conclusion and this book are the result of a long and frustrating search for information on writing arithmetic routines for real-time embedded systems. With instruction cycle times coming down and clock rates going up, it would seem that speed is not a problem in writing fast routines. In addition, math coprocessors are becoming more popular and less expensive than ever before and are readily available. These factors make arithmetic easier and faster to use and implement. However, for many of you the systems that you are working on do not include the latest chips or the faster processors. Some of the most widely used microcontrollers used today are not Digital Signal Processors (DSP), but simple eight-bit controllers such as the Intel 8051 or 8048 microprocessors.
标签: arithmetic high-speed ultimately efficient
上传时间: 2014-11-30
上传用户:lizhen9880
this is μC_OS-Ⅱchinese for arm7 operation,include some useful code
标签: operation chinese this C_OS
上传时间: 2015-11-25
上传用户:klin3139
/// ////单端输入,定时启动,由T2定时,选择AIN0.3为ADC0转化通道//////////////// //////single.c/////////////////////////////////// #include "lcd.h"//笔者所写的LCD显示头文件,具体见LCD章节 /*若读者没有条件使用"lcd.h"的各显示和键盘函数,则可在lcd.h文件中如下定义:
上传时间: 2015-11-26
上传用户:vodssv
ApMl provides users with the ability to crawl the web and download pages to their computer in a directory structure suitable for a Machine Learning system to both train itself and classify new documents. Classification Algorithms include Naive Bayes, KNN
标签: the provides computer download
上传时间: 2015-11-29
上传用户:ywqaxiwang
此程序用来分离一个字符串中的数字及字符,string.zip
上传时间: 2015-12-02
上传用户:wab1981
--- --- --- --- --- --- --- --- --- --- --- --- --- Filename : HP_SENSOR-9.ASM() Remark : --- --- --- --- --- --- --- --- --- --- --- --- --- #include HT82M99E.INC #include USBFIFO.INC #include HP_SENSOR.INC ------------------------------------------------------------------------------ #define CF C #define ZF Z
标签: HP_SENSOR Filename Remark ASM
上传时间: 2015-12-05
上传用户:jjj0202