📄 group__gdsl__heap.html
字号:
<table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Flush a heap. <p>Deallocate all the elements of the heap H by calling H's FREE_F function passed to <a class="el" href="group__gdsl__heap.html#gd1346deeacc31ebad0ec43326210e91b">gdsl_heap_alloc()</a>. H is not deallocated itself and H's name is not modified.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( |H| ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </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>H</em> </td><td>The heap to flush </td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__heap.html#gd1346deeacc31ebad0ec43326210e91b">gdsl_heap_alloc()</a> <p><a class="el" href="group__gdsl__heap.html#g35fbed7f124a3f5c7e560a7cf9505020">gdsl_heap_free()</a> </dd></dl> </td> </tr></table><a class="anchor" name="g042886cdec3eab67e5c9846dcf372153"></a><!-- doxytag: member="gdsl_heap.h::gdsl_heap_get_name" ref="g042886cdec3eab67e5c9846dcf372153" args="(const gdsl_heap_t H)" --><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">const char* gdsl_heap_get_name </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__gdsl__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>H</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Get the name of a heap. <p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </dd></dl><dl compact><dt><b>Postcondition:</b></dt><dd>The returned string MUST NOT be freed. </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>H</em> </td><td>The heap to get the name from </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the name of the heap H. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__heap.html#g006557ed075fb78f548f7d174ba3dc92">gdsl_heap_set_name()</a> </dd></dl> </td> </tr></table><a class="anchor" name="g0b07df738a31dea80792fdc09f1faafe"></a><!-- doxytag: member="gdsl_heap.h::gdsl_heap_get_size" ref="g0b07df738a31dea80792fdc09f1faafe" args="(const gdsl_heap_t H)" --><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_heap_get_size </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__gdsl__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>H</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Get the size of a heap. <p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </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>H</em> </td><td>The heap to get the size from </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the number of elements of H (noted |H|). </dd></dl> </td> </tr></table><a class="anchor" name="gfb1797eb31cd1c7f9011dc5170b3e694"></a><!-- doxytag: member="gdsl_heap.h::gdsl_heap_get_top" ref="gfb1797eb31cd1c7f9011dc5170b3e694" args="(const gdsl_heap_t H)" --><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_heap_get_top </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__gdsl__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>H</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Get the top of a heap. <p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </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>H</em> </td><td>The heap to get the top from </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>the element contained at the top position of the heap H if H is not empty. The returned element is not removed from H. <p>NULL if the heap H is empty. </dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__gdsl__heap.html#g487b264a271d14cb9feeef6f70c31ff0">gdsl_heap_set_top()</a> </dd></dl> </td> </tr></table><a class="anchor" name="gec7eb81d14c4509c7d8f8b1e77fdaae3"></a><!-- doxytag: member="gdsl_heap.h::gdsl_heap_is_empty" ref="gec7eb81d14c4509c7d8f8b1e77fdaae3" args="(const gdsl_heap_t H)" --><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#gf6a258d8f3ee5206d682d799316314b1">bool</a> gdsl_heap_is_empty </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__gdsl__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> </td> <td class="mdname1" valign="top" nowrap> <em>H</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Check if a heap is empty. <p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </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>H</em> </td><td>The heap to check </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>TRUE if the heap H is empty. <p>FALSE if the heap H is not empty. </dd></dl> </td> </tr></table><a class="anchor" name="g006557ed075fb78f548f7d174ba3dc92"></a><!-- doxytag: member="gdsl_heap.h::gdsl_heap_set_name" ref="g006557ed075fb78f548f7d174ba3dc92" args="(gdsl_heap_t H, const char *NEW_NAME)" --><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__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> gdsl_heap_set_name </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__gdsl__heap.html#g78edcc85d3172b3983098958b91d6e44">gdsl_heap_t</a> </td> <td class="mdname" nowrap> <em>H</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>NEW_NAME</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Set the name of a heap. <p>Change the previous name of the heap H to a copy of NEW_NAME.<p><dl compact><dt><b>Note:</b></dt><dd>Complexity: O( 1 ) </dd></dl><dl compact><dt><b>Precondition:</b></dt><dd>H must be a valid gdsl_heap_t </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>H</em> </td><td>The heap to change the name </td></tr> <tr><td valign="top"></td><td valign="top"><em>NEW_NAME</em> </td><td>The new name of H </td></tr> </table></dl>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -