CDPBinaryTree二叉树案例
应用介绍
作者cdpenggod,源码CDPBinaryTree,整理的一些二叉树的相关代码实现,便于理解。
下面是其中一些方法,其他方法自己看demo
Detail see demo.
先序遍历
+(void)firstTraverseWithTree:(CDPBinaryTree *)tree doWithNode:(void(^)(CDPBinaryTree *node))block;
中序遍历
+(void)midTraverseWithTree:(CDPBinaryTree *)tree doWithNode:(void(^)(CDPBinaryTree *node))block;
后序遍历
+(void)lastTraverseWithTree:(CDPBinaryTree *)tree doWithNode:(void(^)(CDPBinaryTree *node))block;
广度优先遍历(层次遍历)
+(void)levelTraverseWithTree:(CDPBinaryTree *)tree doWithNode:(void(^)(CDPBinaryTree *node))block;

©软件著作权归作者所有。本站所有内容均来源于网络,不得违法使用,仅供学习使用,请支持正版!
转载请注明出处: 662P » CDPBinaryTree二叉树案例
发表评论 取消回复