2017小學(xué)二年級(jí)上冊(cè)應(yīng)用題
Practice
Create a tree, which has h (h>0) layers, and its each node has w(w>0) sub-nodes.Please complete the following incomplete solution.
#include <stdlib.h>
#include <string.h>
struct tree{
char info;
p_sub; /pic/>
/pic/>
void dnode ( struct tree* tmp )
{
= malloc( sizeof (struct tree) );
= 0x41;
= NULL;
}
struct tree *dtree (struct tree* subtree, int height, int width)
{
int i;
if ( !subtree ) /pic/>
denode(subtree);
if ( height == 1 )
return subtree;
else if ( height == 2 ) {
struct tree *leaf = NULL;
for ( i=0; i<width; i++ ) {
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i<width; i++ ) {
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
【小學(xué)二年級(jí)上冊(cè)應(yīng)用題】相關(guān)文章:
2016年小學(xué)二年級(jí)上冊(cè)應(yīng)用題03-28
小學(xué)二年級(jí)上冊(cè)應(yīng)用題500道04-27
2015小學(xué)二年級(jí)上冊(cè)數(shù)學(xué)應(yīng)用題04-28
小學(xué)二年級(jí)數(shù)學(xué)上冊(cè)應(yīng)用題作業(yè)02-24
小學(xué)數(shù)學(xué)二年級(jí)上冊(cè)應(yīng)用題集訓(xùn)題03-30
小學(xué)數(shù)學(xué)二年級(jí)上冊(cè)應(yīng)用題比賽試卷01-27
2023二年級(jí)上冊(cè)乘法應(yīng)用題04-09