Data Structures and Algorithms (English) - 6-6 Level-order Traversal(25 分)

简介: Data Structures and Algorithms (English) - 6-6 Level-order Traversal(25 分)

题目链接:点击打开链接

题目大意:略。

解题思路:略。

AC 代码

voidLevel_order ( TreeT, void (*visit)(TreeThisNode) )
{
TreeQue[100];
inthead=0, next=0;
if(T!=NULL) Que[next++]=T;
while(head<next)
    {
if(Que[head]->Left) Que[next++]=Que[head]->Left;
if(Que[head]->Right) Que[next++]=Que[head]->Right;
visit(Que[head++]);
    }
}
目录
相关文章
|
存储 算法
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分)
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分)
113 0
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分)
|
存储 容器
Data Structures and Algorithms (English) - 7-18 Hashing - Hard Version(30 分)
Data Structures and Algorithms (English) - 7-18 Hashing - Hard Version(30 分)
237 0
Data Structures and Algorithms (English) - 7-18 Hashing - Hard Version(30 分)
Data Structures and Algorithms (English) - 6-14 Count Connected Components(20 分)
Data Structures and Algorithms (English) - 6-14 Count Connected Components(20 分)
161 0
Data Structures and Algorithms (English) - 6-13 Topological Sort(25 分)
Data Structures and Algorithms (English) - 6-13 Topological Sort(25 分)
122 0
Data Structures and Algorithms (English) - 6-15 Iterative Mergesort(25 分)
Data Structures and Algorithms (English) - 6-15 Iterative Mergesort(25 分)
205 0
Data Structures and Algorithms (English) - 6-8 Percolate Up and Down(20 分)
Data Structures and Algorithms (English) - 6-8 Percolate Up and Down(20 分)
120 0
Data Structures and Algorithms (English) - 7-8 File Transfer(25 分)
Data Structures and Algorithms (English) - 7-8 File Transfer(25 分)
125 0
Data Structures and Algorithms (English) - 7-9 Huffman Codes(30 分)
Data Structures and Algorithms (English) - 7-9 Huffman Codes(30 分)
118 0
Data Structures and Algorithms (English) - 7-12 How Long Does It Take(25 分)
Data Structures and Algorithms (English) - 7-12 How Long Does It Take(25 分)
133 0
Data Structures and Algorithms (English) - 6-4 Reverse Linked List(20 分)
Data Structures and Algorithms (English) - 6-4 Reverse Linked List(20 分)
135 0
下一篇
oss创建bucket