本文整理汇总了C++中postOrder函数的典型用法代码示例。如果您正苦于以下问题:C++ postOrder函数的具体用法?C++ postOrder怎么用?C++ postOrder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了postOrder函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: postOrder
void postOrder(TreeNodePtr treePtr) {
if (treePtr != NULL) {
postOrder(treePtr->leftPtr);
postOrder(treePtr->rightPtr);
printf("%3d", treePtr->data);
}
}
开发者ID:syvjohan,项目名称:CFun,代码行数:7,代码来源:main.c
示例2: postOrder
void postOrder(node* ptr){
if(ptr!=NULL){
postOrder(ptr->left);
postOrder(ptr->right);
printf("%d ",ptr->data);
}
}
开发者ID:netzanava05,项目名称:netnaja,代码行数:7,代码来源:AVL.c
示例3: postOrder
void BST<ItemType>::postOrder(TreeNode<ItemType> *t, ofstream &file)
{
if(t == NULL) return;
postOrder(t->right, file);
postOrder(t->left, file);
file << t->element << " ";
}
开发者ID:ShawonAshraf,项目名称:CSE225CodesNSU,代码行数:7,代码来源:bst.cpp
示例4: postOrder
void BinaryTree<T>::postOrder(BinaryTree<T>* pNode) {
if (pNode == 0)
return;
postOrder(pNode->left);
postOrder(pNode->right);
cout << pNode->data << endl;
}
开发者ID:Jenna-Quinn,项目名称:cracking-the-coding-interview,代码行数:7,代码来源:BinaryTree.hpp
示例5: postOrder
void postOrder(node *root) {
if (root) {
postOrder(root->left);
postOrder(root->right);
cout << root->data << " ";
}
}
开发者ID:hbdhj,项目名称:c,代码行数:7,代码来源:51.cpp
示例6: postOrder
void Solution508::postOrder(TreeNode *root, unordered_map<int, int> &counter, int &maxCount)
{
if (root == nullptr)
return;
if (root->left)
{
postOrder(root->left, counter, maxCount);
root->val += root->left->val;
}
if (root->right)
{
postOrder(root->right, counter, maxCount);
root->val += root->right->val;
}
int count = counter.count(root->val);
if (count == 0)
{
counter.insert({root->val, 1});
count = 1;
} else
count = ++ counter[root->val];
maxCount = std::max(maxCount, count);
}
开发者ID:zhangxiaoya,项目名称:LeetCodeCPP,代码行数:25,代码来源:Solution508.cpp
示例7: postOrder
void postOrder(TreeNode *root, vector<int>& ret) {
if(!root)
return ;
postOrder(root->left, ret);
postOrder(root->right, ret);
ret.push_back(root->val);
}
开发者ID:futureCoder,项目名称:algorithms,代码行数:7,代码来源:二叉树的后序遍历.cpp
示例8: postOrder
void postOrder(BSTree *myTree) {
if (myTree) {
postOrder(myTree -> leftChild);
postOrder(myTree -> rightChild);
printf(" %d", myTree -> value);
}
}
开发者ID:rodrigoalvesvieira,项目名称:competitive-programming,代码行数:7,代码来源:binary-search-tree-1195.cpp
示例9: postOrder
void postOrder(node *root) {
if(root != NULL){
postOrder(root->left);
postOrder(root->right);
cout << root->data << ' ';
}
}
开发者ID:PollockCR,项目名称:Practice-Problems,代码行数:7,代码来源:TreePostorderTraversal.cpp
示例10: postOrder
void postOrder(struct node *root){
if (root) {
postOrder(root->left);
postOrder(root->right);
printf("%d ", root->key);
}
}
开发者ID:onemid,项目名称:DS-PROGRAM-IN-C,代码行数:7,代码来源:main.c
示例11: postOrder
void postOrder(TreeNode *root,DISPLAY display){
if(root != NULL){
postOrder(root->left, display);
postOrder(root->right, display);
display(root->data);
}
}
开发者ID:beekalam,项目名称:cexamples,代码行数:7,代码来源:tree.c
示例12: postOrder
/**
* print the tree with postorder method
* @param t
*/
void postOrder(tree t) {
if (t) {
postOrder(t->left);
postOrder(t->right);
printf("%d\n", t->elem);
}
}
开发者ID:rommelandrea,项目名称:Binary-Tree,代码行数:11,代码来源:AlberoBin.c
示例13: postOrder
void postOrder(Node * T)
{
if (T->lchild!=NULL)
postOrder(T->lchild);
if (T->rchild!=NULL)
postOrder(T->rchild);
str[(*size)++]=T->c+'0';
}
开发者ID:lilei8630,项目名称:oj,代码行数:8,代码来源:1009.cpp
示例14: postOrder
void BinaryTree::postOrder(treeNode *root)
{
if(root->leftChild)
postOrder(root->leftChild);
if(root->rightChild)
postOrder(root->rightChild);
std::cout<<root->data<<" ";
}
开发者ID:xiaopingz,项目名称:smallpractice,代码行数:8,代码来源:BinaryTree.cpp
示例15: postOrder
void postOrder(struct node *n) {
if (n == NULL)
return;
postOrder(n->left);
postOrder(n->right);
printf("%d ", n->key);
}
开发者ID:salman-bhai,项目名称:DA_A_DS,代码行数:8,代码来源:AVLTree.c
示例16: postOrder
void BinarySearchTree<T>::postOrder(Node<T> *rootTree) const
{
if (rootTree != nullptr) {
postOrder(rootTree->leftChild);
postOrder(rootTree->rightChild);
std::cout << rootTree->data << " ";
}
}
开发者ID:stelro,项目名称:stel_data_structures_and_algorithms,代码行数:8,代码来源:btree.cpp
示例17: postOrder
void postOrder(PTreeNode pNode)
{
if (pNode != NULL) {
postOrder(pNode->left);
postOrder(pNode->right);
visit(pNode);
}
}
开发者ID:ArnaudCourbiere,项目名称:DataStructures,代码行数:8,代码来源:bestTree.c
示例18: postOrder
static void postOrder(RBTree rootNode) {
if(rootNode)
{
postOrder(rootNode->lchild);
postOrder(rootNode->rchild);
printf("%d(%s) ",rootNode->key,(rootNode->color == RED?"红":"黑"));
}
}
开发者ID:SeaHub,项目名称:RedBlackTree,代码行数:8,代码来源:RBTree_print.cpp
示例19: postOrder
void postOrder(char t[][MAX_WORD_SIZE + 1], int root, int n)
{
if (root <= n && strcmp(t[root], "*") != 0) {
postOrder(t, root * 2, n);
postOrder(t, root * 2 + 1, n);
visit(t, root);
}
}
开发者ID:ArnaudCourbiere,项目名称:DataStructures,代码行数:8,代码来源:binaryTreeInArray.c
示例20: postOrder
void postOrder(TNODE *node) {
if (node == NULL) {
return;
}
postOrder(node->leftChild);
postOrder(node->rightChild);
printf("%d ", node->value);
}
开发者ID:phil0s0pher,项目名称:Lab6,代码行数:8,代码来源:functions.c
注:本文中的postOrder函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论