⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group____gdsl__bstree.html

📁 一个通用的C语言实现的数据结构
💻 HTML
📖 第 1 页 / 共 5 页
字号:
      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Get the size of a low-level binary search tree. <p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>nothing. </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>T</em>&nbsp;</td><td>The low-level binary search tree to compute the size from. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the number of elements of T (noted |T|). </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group____gdsl__bstree.html#gd5d0875a352cd61c834bf8fc5696f5e6">_gdsl_bstree_get_height()</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="gd5d0875a352cd61c834bf8fc5696f5e6"></a><!-- doxytag: member="_gdsl_bstree.h::_gdsl_bstree_get_height" ref="gd5d0875a352cd61c834bf8fc5696f5e6" args="(const _gdsl_bstree_t T)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group__gdsl__types.html#g9c34ac44da309b004570530c8cec8a0e">ulong</a> _gdsl_bstree_get_height           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>T</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Get the height of a low-level binary search tree. <p>Compute the height of the low-level binary search tree T (noted h(T)).<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( |T| ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>nothing. </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>T</em>&nbsp;</td><td>The low-level binary search tree to compute the height from. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the height of T. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group____gdsl__bstree.html#g83c4bb599ca019fe55f428862c28ad22">_gdsl_bstree_get_size()</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="gb1579e077e48863cf5784661288cb3af"></a><!-- doxytag: member="_gdsl_bstree.h::_gdsl_bstree_insert" ref="gb1579e077e48863cf5784661288cb3af" args="(_gdsl_bstree_t *T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE, int *RESULT)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a> _gdsl_bstree_insert           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>T</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>const <a class="el" href="group__gdsl__types.html#g200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>COMP_F</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>const <a class="el" href="group__gdsl__types.html#g0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>VALUE</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>int *&nbsp;</td>          <td class="mdname" nowrap> <em>RESULT</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Insert an element into a low-level binary search tree if it's not found or return it. <p>Search for the first element E equal to VALUE into the low-level binary search tree T, by using COMP_F function to find it. If an element E equal to VALUE is found, then it's returned. If no element equal to VALUE is found, then E is inserted and its root returned.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( h(T) ), where log2(|T|) &lt;= h(T) &lt;= |T|-1 </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>COMP_F != NULL &amp; RESULT != NULL. </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>T</em>&nbsp;</td><td>The reference of the low-level binary search tree to use. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>COMP_F</em>&nbsp;</td><td>The comparison function to use to compare T's elements with VALUE to find E. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>VALUE</em>&nbsp;</td><td>The value used to search for the element E. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>RESULT</em>&nbsp;</td><td>The address where the result code will be stored. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the root containing E and RESULT = GDSL_INSERTED if E is inserted. <p>the root containing E and RESULT = GDSL_ERR_DUPLICATE_ENTRY if E is not inserted. <p>NULL and RESULT = GDSL_ERR_MEM_ALLOC in case of failure. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group____gdsl__bstree.html#geee9a8e4bfbca794beab68aa0d67a836">_gdsl_bstree_search()</a> <p><a class="el" href="group____gdsl__bstree.html#g4cb0fde8726d4e8f2abdc55d2fc9a38d">_gdsl_bstree_remove()</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="g4cb0fde8726d4e8f2abdc55d2fc9a38d"></a><!-- doxytag: member="_gdsl_bstree.h::_gdsl_bstree_remove" ref="g4cb0fde8726d4e8f2abdc55d2fc9a38d" args="(_gdsl_bstree_t *T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group__gdsl__types.html#g0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a> _gdsl_bstree_remove           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>T</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>const <a class="el" href="group__gdsl__types.html#g200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>COMP_F</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>const <a class="el" href="group__gdsl__types.html#g0e2b9d7fb5ca9e6d50100e5d9e4bcae7">gdsl_element_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>VALUE</em></td>        </tr>        <tr>          <td class="md"></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </td>    <td><p>Remove an element from a low-level binary search tree. <p>Remove from the low-level binary search tree T the first founded element E equal to VALUE, by using COMP_F function to compare T's elements. If E is found, it is removed from T.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( h(T) ), where log2(|T|) &lt;= h(T) &lt;= |T|-1 <p>The resulting T is modified by examinating the left sub-tree from the founded e. </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>COMP_F != NULL. </dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>T</em>&nbsp;</td><td>The reference of the low-level binary search tree to modify. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>COMP_F</em>&nbsp;</td><td>The comparison function to use to compare T's elements with VALUE to find the element e to remove. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>VALUE</em>&nbsp;</td><td>The value that must be used by COMP_F to find the element e to remove. </td></tr>  </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the fisrt founded element equal to VALUE in T. <p>NULL if no element equal to VALUE is found or if T is empty. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group____gdsl__bstree.html#gb1579e077e48863cf5784661288cb3af">_gdsl_bstree_insert()</a> <p><a class="el" href="group____gdsl__bstree.html#geee9a8e4bfbca794beab68aa0d67a836">_gdsl_bstree_search()</a> </dd></dl>    </td>  </tr></table><a class="anchor" name="geee9a8e4bfbca794beab68aa0d67a836"></a><!-- doxytag: member="_gdsl_bstree.h::_gdsl_bstree_search" ref="geee9a8e4bfbca794beab68aa0d67a836" args="(const _gdsl_bstree_t T, const gdsl_compare_func_t COMP_F, const gdsl_element_t VALUE)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"><a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a> _gdsl_bstree_search           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="group____gdsl__bstree.html#g0b897530b6c7e499f38de973f8e0889d">_gdsl_bstree_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>T</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td class="md"></td>          <td class="md" nowrap>const <a class="el" href="group__gdsl__types.html#g200177a9a1ac3f2363e228b0e5faeda7">gdsl_compare_func_t</a>&nbsp;</td>          <td class="mdname" nowrap> <em>COMP_F</em>, </td>        </tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -