re72.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>&lt;%GLibTraverseType&gt;: </title>
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
  7. <link rel="home" href="index.html" title="">
  8. <link rel="up" href="ch01.html" title="GLib">
  9. <link rel="prev" href="re71.html" title="&lt;%GLibTraverseFlags&gt;">
  10. <link rel="next" href="re73.html" title="&lt;GTree&gt;">
  11. <meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
  12. <link rel="stylesheet" href="style.css" type="text/css">
  13. </head>
  14. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  15. <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts"></td>
  17. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  18. <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
  19. <td><a accesskey="p" href="re71.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re73.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  21. </tr></table>
  22. <div class="refentry">
  23. <a name="id-1.1.73"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;%GLibTraverseType&gt;</h2>
  26. <p>&lt;%GLibTraverseType&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.73.2"></a><h2>Description</h2>
  30. <p>Specifies the type of traversal performed by <code class="function">g_tree_traverse()</code>,
  31. <code class="function">g_node_traverse()</code> and <code class="function">g_node_find()</code>. The different orders are
  32. illustrated here:
  33. - In order: A, B, C, D, E, F, G, H, I
  34. ![](Sorted_binary_tree_inorder.svg)
  35. - Pre order: F, B, A, D, C, E, G, I, H
  36. ![](Sorted_binary_tree_preorder.svg)
  37. - Post order: A, C, E, D, B, H, I, G, F
  38. ![](Sorted_binary_tree_postorder.svg)
  39. - Level order: F, B, G, A, D, I, C, E, H
  40. ![](Sorted_binary_tree_breadth-first_traversal.svg)</p>
  41. </div>
  42. <div class="refsect1">
  43. <a name="id-1.1.73.3"></a><h2>Members</h2>
  44. <div class="refsect2">
  45. <a name="id-1.1.73.3.2"></a><h3>in-order</h3>
  46. <p class="remark"><em><span class="remark">alias <code class="code">G_IN_ORDER</code></span></em></p>
  47. <p>vists a node's left child first, then the node itself,
  48. then its right child. This is the one to use if you
  49. want the output sorted according to the compare
  50. function.</p>
  51. </div>
  52. <div class="refsect2">
  53. <a name="id-1.1.73.3.3"></a><h3>pre-order</h3>
  54. <p class="remark"><em><span class="remark">alias <code class="code">G_PRE_ORDER</code></span></em></p>
  55. <p>visits a node, then its children.</p>
  56. </div>
  57. <div class="refsect2">
  58. <a name="id-1.1.73.3.4"></a><h3>post-order</h3>
  59. <p class="remark"><em><span class="remark">alias <code class="code">G_POST_ORDER</code></span></em></p>
  60. <p>visits the node's children, then the node itself.</p>
  61. </div>
  62. <div class="refsect2">
  63. <a name="id-1.1.73.3.5"></a><h3>level-order</h3>
  64. <p class="remark"><em><span class="remark">alias <code class="code">G_LEVEL_ORDER</code></span></em></p>
  65. <p>is not implemented for
  66. [balanced binary trees][glib-Balanced-Binary-Trees].
  67. For [n-ary trees][glib-N-ary-Trees], it
  68. vists the root node first, then its children, then
  69. its grandchildren, and so on. Note that this is less
  70. efficient than the other orders.</p>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="footer">
  75. <hr>Generated by GTK-Doc V1.33.1</div>
  76. </body>
  77. </html>