mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
766 lines
65 KiB
HTML
766 lines
65 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.6"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Algorithms_in_C: data_structures/binary_trees/words_alphabetical.c File Reference</title>
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../jquery.js"></script>
|
|
<script type="text/javascript" src="../../dynsections.js"></script>
|
|
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../resize.js"></script>
|
|
<script type="text/javascript" src="../../navtreedata.js"></script>
|
|
<script type="text/javascript" src="../../navtree.js"></script>
|
|
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
|
<script type="text/javascript" src="../../search/search.js"></script>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script>
|
|
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
|
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Algorithms_in_C<span id="projectnumber"> 1.0.0</span>
|
|
</div>
|
|
<div id="projectbrief">Set of algorithms implemented in C.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.6 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="../../menudata.js"></script>
|
|
<script type="text/javascript" src="../../menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('../../',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('d3/d78/words__alphabetical_8c.html','../../'); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Data Structures</a> |
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle"><div class="title">words_alphabetical.c File Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Printing the <a href="http://www.dailyfreecode.com/Code/word-list-reads-text-file-makes-2050.aspx" target="_blank">words contained in a file</a> named <code>file.txt</code> in alphabetical order and also their frequencies in to another file "wordcount.txt".
|
|
<a href="#details">More...</a></p>
|
|
<div class="textblock"><code>#include <assert.h></code><br />
|
|
<code>#include <ctype.h></code><br />
|
|
<code>#include <inttypes.h></code><br />
|
|
<code>#include <stdbool.h></code><br />
|
|
<code>#include <stdio.h></code><br />
|
|
<code>#include <stdlib.h></code><br />
|
|
<code>#include <string.h></code><br />
|
|
</div><div class="textblock"><div class="dynheader">
|
|
Include dependency graph for words_alphabetical.c:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d3c/words__alphabetical_8c__incl.svg" width="636" height="124"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d8b/struct_node.html">Node</a></td></tr>
|
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="../../db/d8b/struct_node.html" title="Node, the basic data structure of the tree.">Node</a>, the basic data structure of the tree. <a href="../../db/d8b/struct_node.html#details">More...</a><br /></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:a5157a5b4e164f934602fa78413504029"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029">endProgramAbruptly</a> (char *errorMessage)</td></tr>
|
|
<tr class="memdesc:a5157a5b4e164f934602fa78413504029"><td class="mdescLeft"> </td><td class="mdescRight">Ends program due to an error. <br /></td></tr>
|
|
<tr class="separator:a5157a5b4e164f934602fa78413504029"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a840902ada0e956eb01b529be178748cc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc">freeTreeMemory</a> (struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> *<a class="el" href="../../d5/da1/structnode.html">node</a>)</td></tr>
|
|
<tr class="memdesc:a840902ada0e956eb01b529be178748cc"><td class="mdescLeft"> </td><td class="mdescRight">Frees memory when program is terminating. <br /></td></tr>
|
|
<tr class="separator:a840902ada0e956eb01b529be178748cc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9e3cab68cf6557024f0073f674a307a1"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a9e3cab68cf6557024f0073f674a307a1">getPointerToWord</a> (char *word)</td></tr>
|
|
<tr class="memdesc:a9e3cab68cf6557024f0073f674a307a1"><td class="mdescLeft"> </td><td class="mdescRight">Stores word in memory. <br /></td></tr>
|
|
<tr class="separator:a9e3cab68cf6557024f0073f674a307a1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af1f9b6eb320d872ba0766dc8bd070075"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075">closeFile</a> (FILE *file)</td></tr>
|
|
<tr class="memdesc:af1f9b6eb320d872ba0766dc8bd070075"><td class="mdescLeft"> </td><td class="mdescRight">Closes the file after reading or writing. <br /></td></tr>
|
|
<tr class="separator:af1f9b6eb320d872ba0766dc8bd070075"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1e5ad8401396df36ab585d79f3309fd9"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a1e5ad8401396df36ab585d79f3309fd9">allocateMemoryForNode</a> ()</td></tr>
|
|
<tr class="memdesc:a1e5ad8401396df36ab585d79f3309fd9"><td class="mdescLeft"> </td><td class="mdescRight">Reserves memory for new node. <br /></td></tr>
|
|
<tr class="separator:a1e5ad8401396df36ab585d79f3309fd9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a22516c70583c9fa78e4edffb063836cc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc">writeContentOfTreeToFile</a> (struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> *<a class="el" href="../../d5/da1/structnode.html">node</a>, FILE *file)</td></tr>
|
|
<tr class="memdesc:a22516c70583c9fa78e4edffb063836cc"><td class="mdescLeft"> </td><td class="mdescRight">Writes contents of tree to another file alphabetically. <br /></td></tr>
|
|
<tr class="separator:a22516c70583c9fa78e4edffb063836cc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0ac11529daf94e98f7114a6e938679a9"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a> (char *word, struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> *currentNode)</td></tr>
|
|
<tr class="memdesc:a0ac11529daf94e98f7114a6e938679a9"><td class="mdescLeft"> </td><td class="mdescRight">Adds word (node) to the correct position in tree. <br /></td></tr>
|
|
<tr class="separator:a0ac11529daf94e98f7114a6e938679a9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a151b2c78ae821d0495faf936a1c2530f"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#a151b2c78ae821d0495faf936a1c2530f">readWordsInFileToTree</a> (FILE *file, struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> *root)</td></tr>
|
|
<tr class="memdesc:a151b2c78ae821d0495faf936a1c2530f"><td class="mdescLeft"> </td><td class="mdescRight">Reads words from file to tree. <br /></td></tr>
|
|
<tr class="separator:a151b2c78ae821d0495faf936a1c2530f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
|
|
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft"> </td><td class="mdescRight">Self-test implementations. <br /></td></tr>
|
|
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d78/words__alphabetical_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
|
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <br /></td></tr>
|
|
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Printing the <a href="http://www.dailyfreecode.com/Code/word-list-reads-text-file-makes-2050.aspx" target="_blank">words contained in a file</a> named <code>file.txt</code> in alphabetical order and also their frequencies in to another file "wordcount.txt". </p>
|
|
<p>Given a file (<code>file.txt</code>) containing words (like a publication or a novel), where words are separated by a space, newline, or underscore. This program prints (writes or outputs) to another file (<code>wordcount.txt</code>), the individual words contained in 'file.txt' with their frequencies (number of occurrences) each on a newline and in alphabetical order. This program uses the binary tree data structure to accomplish this task. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/RandyKdev" target="_blank">Randy Kwalar</a> </dd></dl>
|
|
</div><h2 class="groupheader">Function Documentation</h2>
|
|
<a id="a0ac11529daf94e98f7114a6e938679a9" name="a0ac11529daf94e98f7114a6e938679a9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0ac11529daf94e98f7114a6e938679a9">◆ </a></span>addWordToTree()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * addWordToTree </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>word</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td>
|
|
<td class="paramname"><em>currentNode</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Adds word (node) to the correct position in tree. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">word</td><td>word to be inserted in to the tree </td></tr>
|
|
<tr><td class="paramname">currentNode</td><td>node which is being compared </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>a pointer to the root node </dd></dl>
|
|
<p>< holds compare state</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 145</span>{</div>
|
|
<div class="line"><span class="lineno"> 146</span> <span class="keywordflow">if</span> (currentNode == NULL) <span class="comment">// checks if `currentNode` is `NULL`</span></div>
|
|
<div class="line"><span class="lineno"> 147</span> {</div>
|
|
<div class="line"><span class="lineno"> 148</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../db/d8b/struct_node.html">Node</a> *currentNode =</div>
|
|
<div class="line"><span class="lineno"> 149</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a1e5ad8401396df36ab585d79f3309fd9">allocateMemoryForNode</a>(); <span class="comment">// allocates memory for new node</span></div>
|
|
<div class="line"><span class="lineno"> 150</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a> = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a9e3cab68cf6557024f0073f674a307a1">getPointerToWord</a>(<a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a>); <span class="comment">// stores `word` in memory</span></div>
|
|
<div class="line"><span class="lineno"> 151</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#abe1c200da58f5276c6fd74f640a29a02">frequency</a> = 1; <span class="comment">// initializes the word frequency to 1</span></div>
|
|
<div class="line"><span class="lineno"> 152</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36">left</a> = NULL; <span class="comment">// sets left node to `NULL`</span></div>
|
|
<div class="line"><span class="lineno"> 153</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4">right</a> = NULL; <span class="comment">// sets right node to `NULL`</span></div>
|
|
<div class="line"><span class="lineno"> 154</span> <span class="keywordflow">return</span> currentNode; <span class="comment">// returns pointer to newly created node</span></div>
|
|
<div class="line"><span class="lineno"> 155</span> }</div>
|
|
<div class="line"><span class="lineno"> 156</span> </div>
|
|
<div class="line"><span class="lineno"> 157</span> int64_t compared = strcmp(<a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a>, currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a>); <span class="comment">///< holds compare state</span></div>
|
|
<div class="line"><span class="lineno"> 158</span> </div>
|
|
<div class="line"><span class="lineno"> 159</span> <span class="keywordflow">if</span> (compared > 0) {</div>
|
|
<div class="line"><span class="lineno"> 160</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4">right</a> = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a>(<a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a>,</div>
|
|
<div class="line"><span class="lineno"> 161</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4">right</a>); <span class="comment">// adds `word` to right sub tree if `word` is</span></div>
|
|
<div class="line"><span class="lineno"> 162</span> <span class="comment">// alphabetically greater than `currentNode->word`</span></div>
|
|
<div class="line"><span class="lineno"> 163</span> }</div>
|
|
<div class="line"><span class="lineno"> 164</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (compared < 0) {</div>
|
|
<div class="line"><span class="lineno"> 165</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36">left</a> = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a>(<a class="code hl_variable" href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">word</a>,</div>
|
|
<div class="line"><span class="lineno"> 166</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36">left</a>); <span class="comment">// adds `word` to left sub tree if `word` is</span></div>
|
|
<div class="line"><span class="lineno"> 167</span> <span class="comment">// alphabetically less than `currentNode->word`</span></div>
|
|
<div class="line"><span class="lineno"> 168</span> }</div>
|
|
<div class="line"><span class="lineno"> 169</span> <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><span class="lineno"> 170</span> currentNode-><a class="code hl_variable" href="../../db/d8b/struct_node.html#abe1c200da58f5276c6fd74f640a29a02">frequency</a>++; <span class="comment">// increments `currentNode` frequency if `word` is the same as `currentNode->word`</span></div>
|
|
<div class="line"><span class="lineno"> 171</span> }</div>
|
|
<div class="line"><span class="lineno"> 172</span> </div>
|
|
<div class="line"><span class="lineno"> 173</span> <span class="keywordflow">return</span> currentNode; <span class="comment">// returns pointer to current node</span></div>
|
|
<div class="line"><span class="lineno"> 174</span>}</div>
|
|
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdoc">Node, the basic data structure of the tree.</div><div class="ttdef"><b>Definition:</b> threaded_binary_trees.c:27</div></div>
|
|
<div class="ttc" id="astruct_node_html_abe1c200da58f5276c6fd74f640a29a02"><div class="ttname"><a href="../../db/d8b/struct_node.html#abe1c200da58f5276c6fd74f640a29a02">Node::frequency</a></div><div class="ttdeci">uint64_t frequency</div><div class="ttdoc">number of occurrences of the word</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:31</div></div>
|
|
<div class="ttc" id="astruct_node_html_ad0976834843c7618677d22a10c495b36"><div class="ttname"><a href="../../db/d8b/struct_node.html#ad0976834843c7618677d22a10c495b36">Node::left</a></div><div class="ttdeci">struct Node * left</div><div class="ttdoc">pointer to the left child node</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:32</div></div>
|
|
<div class="ttc" id="astruct_node_html_af99e7102380da88d7c079fa264230cf4"><div class="ttname"><a href="../../db/d8b/struct_node.html#af99e7102380da88d7c079fa264230cf4">Node::right</a></div><div class="ttdeci">struct Node * right</div><div class="ttdoc">pointer to the right child node</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:33</div></div>
|
|
<div class="ttc" id="astruct_node_html_afa6ccc6414d3e0bcacb715dcdf764bca"><div class="ttname"><a href="../../db/d8b/struct_node.html#afa6ccc6414d3e0bcacb715dcdf764bca">Node::word</a></div><div class="ttdeci">char * word</div><div class="ttdoc">the word (value) of the node</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:30</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a0ac11529daf94e98f7114a6e938679a9"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a></div><div class="ttdeci">struct Node * addWordToTree(char *word, struct Node *currentNode)</div><div class="ttdoc">Adds word (node) to the correct position in tree.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:144</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a1e5ad8401396df36ab585d79f3309fd9"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a1e5ad8401396df36ab585d79f3309fd9">allocateMemoryForNode</a></div><div class="ttdeci">struct Node * allocateMemoryForNode()</div><div class="ttdoc">Reserves memory for new node.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:102</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a9e3cab68cf6557024f0073f674a307a1"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a9e3cab68cf6557024f0073f674a307a1">getPointerToWord</a></div><div class="ttdeci">char * getPointerToWord(char *word)</div><div class="ttdoc">Stores word in memory.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:70</div></div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a0ac11529daf94e98f7114a6e938679a9_cgraph.svg" width="524" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1e5ad8401396df36ab585d79f3309fd9" name="a1e5ad8401396df36ab585d79f3309fd9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1e5ad8401396df36ab585d79f3309fd9">◆ </a></span>allocateMemoryForNode()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * allocateMemoryForNode </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Reserves memory for new node. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>a pointer to the newly allocated node if memory IS successfully reserved </dd>
|
|
<dd>
|
|
<code>NULL</code> if memory is NOT reserved </dd></dl>
|
|
<p>< pointer to the node</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 103</span>{</div>
|
|
<div class="line"><span class="lineno"> 104</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../db/d8b/struct_node.html">Node</a> *<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a> =</div>
|
|
<div class="line"><span class="lineno"> 105</span> (<span class="keyword">struct </span><a class="code hl_struct" href="../../db/d8b/struct_node.html">Node</a> *)<a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee">malloc</a>(<span class="keyword">sizeof</span>(<span class="keyword">struct</span> <a class="code hl_struct" href="../../db/d8b/struct_node.html">Node</a>)); <span class="comment">///< pointer to the node</span></div>
|
|
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a> != NULL)</div>
|
|
<div class="line"><span class="lineno"> 107</span> {</div>
|
|
<div class="line"><span class="lineno"> 108</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>;</div>
|
|
<div class="line"><span class="lineno"> 109</span> }</div>
|
|
<div class="line"><span class="lineno"> 110</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029">endProgramAbruptly</a>(</div>
|
|
<div class="line"><span class="lineno"> 111</span> <span class="stringliteral">"\nA problem occurred while reserving memory for the structure\n"</span>);</div>
|
|
<div class="line"><span class="lineno"> 112</span> <span class="keywordflow">return</span> NULL;</div>
|
|
<div class="line"><span class="lineno"> 113</span>}</div>
|
|
<div class="ttc" id="amalloc__dbg_8h_html_a725f50ecaf1959d96de79b36b4788fee"><div class="ttname"><a href="../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee">malloc</a></div><div class="ttdeci">#define malloc(bytes)</div><div class="ttdoc">This macro replace the standard malloc function with malloc_dbg.</div><div class="ttdef"><b>Definition:</b> malloc_dbg.h:18</div></div>
|
|
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdoc">Node, the basic data structure in the tree.</div><div class="ttdef"><b>Definition:</b> binary_search_tree.c:15</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a5157a5b4e164f934602fa78413504029"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029">endProgramAbruptly</a></div><div class="ttdeci">void endProgramAbruptly(char *errorMessage)</div><div class="ttdoc">Ends program due to an error.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:41</div></div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a1e5ad8401396df36ab585d79f3309fd9_cgraph.svg" width="363" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af1f9b6eb320d872ba0766dc8bd070075" name="af1f9b6eb320d872ba0766dc8bd070075"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af1f9b6eb320d872ba0766dc8bd070075">◆ </a></span>closeFile()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void closeFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">FILE * </td>
|
|
<td class="paramname"><em>file</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Closes the file after reading or writing. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">file</td><td>pointer to the file to be closed </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 91</span>{</div>
|
|
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">if</span> (fclose(file)) {</div>
|
|
<div class="line"><span class="lineno"> 93</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029">endProgramAbruptly</a>(<span class="stringliteral">"\nA Problem Occurred while closing a file\n"</span>);</div>
|
|
<div class="line"><span class="lineno"> 94</span> }</div>
|
|
<div class="line"><span class="lineno"> 95</span>}</div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_af1f9b6eb320d872ba0766dc8bd070075_cgraph.svg" width="274" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5157a5b4e164f934602fa78413504029" name="a5157a5b4e164f934602fa78413504029"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5157a5b4e164f934602fa78413504029">◆ </a></span>endProgramAbruptly()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void endProgramAbruptly </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>errorMessage</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Ends program due to an error. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">errorMessage</td><td>the error message to be printed </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 42</span>{</div>
|
|
<div class="line"><span class="lineno"> 43</span> fprintf(stderr, <span class="stringliteral">"%s\n"</span>, errorMessage);</div>
|
|
<div class="line"><span class="lineno"> 44</span> exit(EXIT_FAILURE);</div>
|
|
<div class="line"><span class="lineno"> 45</span>}</div>
|
|
</div><!-- fragment -->
|
|
</div>
|
|
</div>
|
|
<a id="a840902ada0e956eb01b529be178748cc" name="a840902ada0e956eb01b529be178748cc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a840902ada0e956eb01b529be178748cc">◆ </a></span>freeTreeMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void freeTreeMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td>
|
|
<td class="paramname"><em>node</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Frees memory when program is terminating. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">node</td><td>pointer to current node </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 53</span>{</div>
|
|
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a> != NULL)</div>
|
|
<div class="line"><span class="lineno"> 55</span> {</div>
|
|
<div class="line"><span class="lineno"> 56</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc">freeTreeMemory</a>(<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>-><a class="code hl_variable" href="../../d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0">left</a>);</div>
|
|
<div class="line"><span class="lineno"> 57</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc">freeTreeMemory</a>(<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>-><a class="code hl_variable" href="../../d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c">right</a>);</div>
|
|
<div class="line"><span class="lineno"> 58</span> <a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768">free</a>(<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>->word); <span class="comment">// freeing node->word because memory was allocated</span></div>
|
|
<div class="line"><span class="lineno"> 59</span> <span class="comment">// using malloc</span></div>
|
|
<div class="line"><span class="lineno"> 60</span> <a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768">free</a>(<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>); <span class="comment">// freeing node because memory was allocated using malloc</span></div>
|
|
<div class="line"><span class="lineno"> 61</span> }</div>
|
|
<div class="line"><span class="lineno"> 62</span>}</div>
|
|
<div class="ttc" id="amalloc__dbg_8h_html_a9cc854374299a1dd933bf62029761768"><div class="ttname"><a href="../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768">free</a></div><div class="ttdeci">#define free(ptr)</div><div class="ttdoc">This macro replace the standard free function with free_dbg.</div><div class="ttdef"><b>Definition:</b> malloc_dbg.h:26</div></div>
|
|
<div class="ttc" id="astructnode_html_a51e160f22dc6064bac4a4f9f1d931c2c"><div class="ttname"><a href="../../d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c">node::right</a></div><div class="ttdeci">struct node * right</div><div class="ttdoc">right child</div><div class="ttdef"><b>Definition:</b> binary_search_tree.c:17</div></div>
|
|
<div class="ttc" id="astructnode_html_af7109e6ffd82cbbb705e486fd0ce92f0"><div class="ttname"><a href="../../d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0">node::left</a></div><div class="ttdeci">struct node * left</div><div class="ttdoc">left child</div><div class="ttdef"><b>Definition:</b> binary_search_tree.c:16</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a840902ada0e956eb01b529be178748cc"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc">freeTreeMemory</a></div><div class="ttdeci">void freeTreeMemory(struct Node *node)</div><div class="ttdoc">Frees memory when program is terminating.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:52</div></div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a840902ada0e956eb01b529be178748cc_cgraph.svg" width="128" height="60"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a9e3cab68cf6557024f0073f674a307a1" name="a9e3cab68cf6557024f0073f674a307a1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9e3cab68cf6557024f0073f674a307a1">◆ </a></span>getPointerToWord()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * getPointerToWord </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>word</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Stores word in memory. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">word</td><td>word to be stored in memory </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>a pointer to the newly allocated word if the word IS stored successfully </dd>
|
|
<dd>
|
|
<code>NULL</code> if the word is NOT stored </dd></dl>
|
|
<p>< pointer to string</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 71</span>{</div>
|
|
<div class="line"><span class="lineno"> 72</span> <span class="keywordtype">char</span> *<span class="keywordtype">string</span> =</div>
|
|
<div class="line"><span class="lineno"> 73</span> (<span class="keywordtype">char</span> *)<a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee">malloc</a>((strlen(word) + 1) * <span class="keyword">sizeof</span>(char)); <span class="comment">///< pointer to string</span></div>
|
|
<div class="line"><span class="lineno"> 74</span> <span class="comment">// + 1 is for the '\0' character</span></div>
|
|
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">if</span> (<span class="keywordtype">string</span> != NULL)</div>
|
|
<div class="line"><span class="lineno"> 76</span> {</div>
|
|
<div class="line"><span class="lineno"> 77</span> strcpy(<span class="keywordtype">string</span>, word);</div>
|
|
<div class="line"><span class="lineno"> 78</span> <span class="keywordflow">return</span> string;</div>
|
|
<div class="line"><span class="lineno"> 79</span> }</div>
|
|
<div class="line"><span class="lineno"> 80</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a5157a5b4e164f934602fa78413504029">endProgramAbruptly</a>(</div>
|
|
<div class="line"><span class="lineno"> 81</span> <span class="stringliteral">"\nA problem occurred while reserving memory for the word\n"</span>);</div>
|
|
<div class="line"><span class="lineno"> 82</span> <span class="keywordflow">return</span> NULL;</div>
|
|
<div class="line"><span class="lineno"> 83</span>}</div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a9e3cab68cf6557024f0073f674a307a1_cgraph.svg" width="324" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int main </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Main function. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 313</span>{</div>
|
|
<div class="line"><span class="lineno"> 314</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
|
<div class="line"><span class="lineno"> 315</span> <span class="keywordflow">return</span> 0;</div>
|
|
<div class="line"><span class="lineno"> 316</span>}</div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:244</div></div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="100%" height="472"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a151b2c78ae821d0495faf936a1c2530f" name="a151b2c78ae821d0495faf936a1c2530f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a151b2c78ae821d0495faf936a1c2530f">◆ </a></span>readWordsInFileToTree()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * readWordsInFileToTree </td>
|
|
<td>(</td>
|
|
<td class="paramtype">FILE * </td>
|
|
<td class="paramname"><em>file</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td>
|
|
<td class="paramname"><em>root</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Reads words from file to tree. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">file</td><td>file to be read from </td></tr>
|
|
<tr><td class="paramname">root</td><td>root node of tree </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>a pointer to the root node </dd></dl>
|
|
<p>< pointer to the input string</p>
|
|
<p>< temp storage of characters</p>
|
|
<p>< bool to mark the end of a word</p>
|
|
<p>< position in inputString to place the inputChar</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 183</span>{</div>
|
|
<div class="line"><span class="lineno"> 184</span> <span class="comment">// longest english word = 45 chars</span></div>
|
|
<div class="line"><span class="lineno"> 185</span> <span class="comment">// +1 for '\0' = 46 chars</span></div>
|
|
<div class="line"><span class="lineno"> 186</span> <span class="keywordtype">char</span> *inputString =</div>
|
|
<div class="line"><span class="lineno"> 187</span> (<span class="keywordtype">char</span> *)<a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a725f50ecaf1959d96de79b36b4788fee">malloc</a>(46 * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>)); <span class="comment">///< pointer to the input string</span></div>
|
|
<div class="line"><span class="lineno"> 188</span> </div>
|
|
<div class="line"><span class="lineno"> 189</span> <span class="keywordtype">char</span> inputChar; <span class="comment">///< temp storage of characters</span></div>
|
|
<div class="line"><span class="lineno"> 190</span> <span class="keywordtype">bool</span> isPrevCharAlpha = <span class="keyword">false</span>; <span class="comment">///< bool to mark the end of a word</span></div>
|
|
<div class="line"><span class="lineno"> 191</span> uint8_t pos = 0; <span class="comment">///< position in inputString to place the inputChar</span></div>
|
|
<div class="line"><span class="lineno"> 192</span> </div>
|
|
<div class="line"><span class="lineno"> 193</span> <span class="keywordflow">while</span> ((inputChar = fgetc(file)) != EOF)</div>
|
|
<div class="line"><span class="lineno"> 194</span> {</div>
|
|
<div class="line"><span class="lineno"> 195</span> <span class="keywordflow">if</span> (pos > 0)</div>
|
|
<div class="line"><span class="lineno"> 196</span> isPrevCharAlpha = isalpha(inputString[pos - 1]);</div>
|
|
<div class="line"><span class="lineno"> 197</span> </div>
|
|
<div class="line"><span class="lineno"> 198</span> <span class="comment">// checks if character is letter</span></div>
|
|
<div class="line"><span class="lineno"> 199</span> <span class="keywordflow">if</span> (isalpha(inputChar))</div>
|
|
<div class="line"><span class="lineno"> 200</span> {</div>
|
|
<div class="line"><span class="lineno"> 201</span> inputString[pos++] = tolower(inputChar);</div>
|
|
<div class="line"><span class="lineno"> 202</span> <span class="keywordflow">continue</span>;</div>
|
|
<div class="line"><span class="lineno"> 203</span> }</div>
|
|
<div class="line"><span class="lineno"> 204</span> </div>
|
|
<div class="line"><span class="lineno"> 205</span> <span class="comment">// checks if character is ' or - and if it is preceded by a letter eg</span></div>
|
|
<div class="line"><span class="lineno"> 206</span> <span class="comment">// yours-not, persons' (valid)</span></div>
|
|
<div class="line"><span class="lineno"> 207</span> <span class="keywordflow">if</span> ((inputChar == <span class="charliteral">'\''</span> || inputChar == <span class="charliteral">'-'</span>) && isPrevCharAlpha)</div>
|
|
<div class="line"><span class="lineno"> 208</span> {</div>
|
|
<div class="line"><span class="lineno"> 209</span> inputString[pos++] = inputChar;</div>
|
|
<div class="line"><span class="lineno"> 210</span> <span class="keywordflow">continue</span>;</div>
|
|
<div class="line"><span class="lineno"> 211</span> }</div>
|
|
<div class="line"><span class="lineno"> 212</span> </div>
|
|
<div class="line"><span class="lineno"> 213</span> <span class="comment">// makes sure that there is something valid in inputString</span></div>
|
|
<div class="line"><span class="lineno"> 214</span> <span class="keywordflow">if</span> (pos == 0)</div>
|
|
<div class="line"><span class="lineno"> 215</span> <span class="keywordflow">continue</span>;</div>
|
|
<div class="line"><span class="lineno"> 216</span> </div>
|
|
<div class="line"><span class="lineno"> 217</span> <span class="comment">// if last character is not letter and is not ' then replace by \0</span></div>
|
|
<div class="line"><span class="lineno"> 218</span> <span class="keywordflow">if</span> (!isPrevCharAlpha && inputString[pos - 1] != <span class="charliteral">'\''</span>)</div>
|
|
<div class="line"><span class="lineno"> 219</span> pos--;</div>
|
|
<div class="line"><span class="lineno"> 220</span> inputString[pos] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><span class="lineno"> 221</span> pos = 0;</div>
|
|
<div class="line"><span class="lineno"> 222</span> isPrevCharAlpha = <span class="keyword">false</span>;</div>
|
|
<div class="line"><span class="lineno"> 223</span> root = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a>(inputString, root);</div>
|
|
<div class="line"><span class="lineno"> 224</span> }</div>
|
|
<div class="line"><span class="lineno"> 225</span> </div>
|
|
<div class="line"><span class="lineno"> 226</span> <span class="comment">// this is to catch the case for the EOF being immediately after the last</span></div>
|
|
<div class="line"><span class="lineno"> 227</span> <span class="comment">// letter or '</span></div>
|
|
<div class="line"><span class="lineno"> 228</span> <span class="keywordflow">if</span> (pos > 0)</div>
|
|
<div class="line"><span class="lineno"> 229</span> {</div>
|
|
<div class="line"><span class="lineno"> 230</span> <span class="keywordflow">if</span> (!isPrevCharAlpha && inputString[pos - 1] != <span class="charliteral">'\''</span>)</div>
|
|
<div class="line"><span class="lineno"> 231</span> pos--;</div>
|
|
<div class="line"><span class="lineno"> 232</span> inputString[pos] = <span class="charliteral">'\0'</span>;</div>
|
|
<div class="line"><span class="lineno"> 233</span> root = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a0ac11529daf94e98f7114a6e938679a9">addWordToTree</a>(inputString, root);</div>
|
|
<div class="line"><span class="lineno"> 234</span> }</div>
|
|
<div class="line"><span class="lineno"> 235</span> </div>
|
|
<div class="line"><span class="lineno"> 236</span> <a class="code hl_define" href="../../d2/ddd/malloc__dbg_8h.html#a9cc854374299a1dd933bf62029761768">free</a>(inputString);</div>
|
|
<div class="line"><span class="lineno"> 237</span> <span class="keywordflow">return</span> root;</div>
|
|
<div class="line"><span class="lineno"> 238</span>}</div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a151b2c78ae821d0495faf936a1c2530f_cgraph.svg" width="100%" height="364"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void test </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Self-test implementations. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
|
<p>< pointer to the root node</p>
|
|
<p>< pointer to the file</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 245</span>{</div>
|
|
<div class="line"><span class="lineno"> 246</span> <span class="keyword">struct </span><a class="code hl_struct" href="../../db/d8b/struct_node.html">Node</a> *root = NULL; <span class="comment">///< pointer to the root node</span></div>
|
|
<div class="line"><span class="lineno"> 247</span> FILE *file = NULL; <span class="comment">///< pointer to the file</span></div>
|
|
<div class="line"><span class="lineno"> 248</span> </div>
|
|
<div class="line"><span class="lineno"> 249</span> file = fopen(<span class="stringliteral">"file.txt"</span>, <span class="stringliteral">"w"</span>); <span class="comment">// creates test file in write mode</span></div>
|
|
<div class="line"><span class="lineno"> 250</span> </div>
|
|
<div class="line"><span class="lineno"> 251</span> fprintf(file,</div>
|
|
<div class="line"><span class="lineno"> 252</span> <span class="stringliteral">"hey_this, is a. test input \n to a_file"</span>); <span class="comment">// writes test data to</span></div>
|
|
<div class="line"><span class="lineno"> 253</span> <span class="comment">// test file</span></div>
|
|
<div class="line"><span class="lineno"> 254</span> </div>
|
|
<div class="line"><span class="lineno"> 255</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075">closeFile</a>(file); <span class="comment">// closes test file</span></div>
|
|
<div class="line"><span class="lineno"> 256</span> file = fopen(<span class="stringliteral">"file.txt"</span>, <span class="stringliteral">"r"</span>); <span class="comment">// reopens test file in read mode</span></div>
|
|
<div class="line"><span class="lineno"> 257</span> </div>
|
|
<div class="line"><span class="lineno"> 258</span> root = <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a151b2c78ae821d0495faf936a1c2530f">readWordsInFileToTree</a>(file,</div>
|
|
<div class="line"><span class="lineno"> 259</span> root); <span class="comment">// reads words from test file to tree</span></div>
|
|
<div class="line"><span class="lineno"> 260</span> </div>
|
|
<div class="line"><span class="lineno"> 261</span> <span class="comment">// Tests to check if words were added to correct position in tree and also</span></div>
|
|
<div class="line"><span class="lineno"> 262</span> <span class="comment">// if their frequencies were added correctly</span></div>
|
|
<div class="line"><span class="lineno"> 263</span> assert(strcmp(root->word, <span class="stringliteral">"hey"</span>) == 0);</div>
|
|
<div class="line"><span class="lineno"> 264</span> assert(root->frequency == 1);</div>
|
|
<div class="line"><span class="lineno"> 265</span> assert(strcmp(root->left->word, <span class="stringliteral">"a"</span>) == 0);</div>
|
|
<div class="line"><span class="lineno"> 266</span> assert(root->left->frequency == 2);</div>
|
|
<div class="line"><span class="lineno"> 267</span> assert(strcmp(root->right->word, <span class="stringliteral">"this"</span>) == 0);</div>
|
|
<div class="line"><span class="lineno"> 268</span> assert(strcmp(root->left->right->word, <span class="stringliteral">"file"</span>) == 0);</div>
|
|
<div class="line"><span class="lineno"> 269</span> assert(strcmp(root->right->left->word, <span class="stringliteral">"is"</span>) == 0);</div>
|
|
<div class="line"><span class="lineno"> 270</span> </div>
|
|
<div class="line"><span class="lineno"> 271</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075">closeFile</a>(file); <span class="comment">// closes test file</span></div>
|
|
<div class="line"><span class="lineno"> 272</span> remove(<span class="stringliteral">"file.txt"</span>); <span class="comment">// deletes test file from storage</span></div>
|
|
<div class="line"><span class="lineno"> 273</span> </div>
|
|
<div class="line"><span class="lineno"> 274</span> file = fopen(<span class="stringliteral">"wordcount.txt"</span>, <span class="stringliteral">"a"</span>); <span class="comment">// creates write file</span></div>
|
|
<div class="line"><span class="lineno"> 275</span> fprintf(file, <span class="stringliteral">"%-5s \t %9s \t %s \n"</span>, <span class="stringliteral">"S/N"</span>, <span class="stringliteral">"FREQUENCY"</span>,</div>
|
|
<div class="line"><span class="lineno"> 276</span> <span class="stringliteral">"WORD"</span>); <span class="comment">// prints the heading to `wordcount.txt`</span></div>
|
|
<div class="line"><span class="lineno"> 277</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc">writeContentOfTreeToFile</a>(</div>
|
|
<div class="line"><span class="lineno"> 278</span> root, file); <span class="comment">// writes content of tree to file (`wordcount.txt`)</span></div>
|
|
<div class="line"><span class="lineno"> 279</span> </div>
|
|
<div class="line"><span class="lineno"> 280</span> <span class="comment">// Here is how the output to `wordcount.txt` should look like</span></div>
|
|
<div class="line"><span class="lineno"> 281</span> <span class="keywordtype">char</span> *correctString =</div>
|
|
<div class="line"><span class="lineno"> 282</span> <span class="stringliteral">"S/N FREQUENCY WORD \n"</span></div>
|
|
<div class="line"><span class="lineno"> 283</span> <span class="stringliteral">"1 2 a \n"</span></div>
|
|
<div class="line"><span class="lineno"> 284</span> <span class="stringliteral">"2 1 file \n"</span></div>
|
|
<div class="line"><span class="lineno"> 285</span> <span class="stringliteral">"3 1 hey \n"</span></div>
|
|
<div class="line"><span class="lineno"> 286</span> <span class="stringliteral">"4 1 input \n"</span></div>
|
|
<div class="line"><span class="lineno"> 287</span> <span class="stringliteral">"5 1 is \n"</span></div>
|
|
<div class="line"><span class="lineno"> 288</span> <span class="stringliteral">"6 1 n \n"</span></div>
|
|
<div class="line"><span class="lineno"> 289</span> <span class="stringliteral">"7 1 test \n"</span></div>
|
|
<div class="line"><span class="lineno"> 290</span> <span class="stringliteral">"8 1 this \n"</span></div>
|
|
<div class="line"><span class="lineno"> 291</span> <span class="stringliteral">"9 1 to \n"</span>;</div>
|
|
<div class="line"><span class="lineno"> 292</span> </div>
|
|
<div class="line"><span class="lineno"> 293</span> int16_t inputChar; <span class="comment">// holds the current character in `wordcount.txt`</span></div>
|
|
<div class="line"><span class="lineno"> 294</span> uint64_t i = 0; <span class="comment">// holds the current index in `correctString`</span></div>
|
|
<div class="line"><span class="lineno"> 295</span> </div>
|
|
<div class="line"><span class="lineno"> 296</span> <span class="comment">// Checks if the content in `wordcount.txt` is as expected (the same as in</span></div>
|
|
<div class="line"><span class="lineno"> 297</span> <span class="comment">// `correctString`)</span></div>
|
|
<div class="line"><span class="lineno"> 298</span> <span class="keywordflow">while</span> ((inputChar = fgetc(file)) != EOF) {</div>
|
|
<div class="line"><span class="lineno"> 299</span> assert(inputChar == correctString[i++]);</div>
|
|
<div class="line"><span class="lineno"> 300</span> }</div>
|
|
<div class="line"><span class="lineno"> 301</span> </div>
|
|
<div class="line"><span class="lineno"> 302</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075">closeFile</a>(file); <span class="comment">// closes `wordcount.txt`</span></div>
|
|
<div class="line"><span class="lineno"> 303</span> remove(<span class="stringliteral">"wordcount.txt"</span>); <span class="comment">// deletes `wordcount.txt`</span></div>
|
|
<div class="line"><span class="lineno"> 304</span> </div>
|
|
<div class="line"><span class="lineno"> 305</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a840902ada0e956eb01b529be178748cc">freeTreeMemory</a>(root); <span class="comment">// frees memory taken up by the tree</span></div>
|
|
<div class="line"><span class="lineno"> 306</span>}</div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a151b2c78ae821d0495faf936a1c2530f"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a151b2c78ae821d0495faf936a1c2530f">readWordsInFileToTree</a></div><div class="ttdeci">struct Node * readWordsInFileToTree(FILE *file, struct Node *root)</div><div class="ttdoc">Reads words from file to tree.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:182</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_a22516c70583c9fa78e4edffb063836cc"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc">writeContentOfTreeToFile</a></div><div class="ttdeci">void writeContentOfTreeToFile(struct Node *node, FILE *file)</div><div class="ttdoc">Writes contents of tree to another file alphabetically.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:121</div></div>
|
|
<div class="ttc" id="awords__alphabetical_8c_html_af1f9b6eb320d872ba0766dc8bd070075"><div class="ttname"><a href="../../d3/d78/words__alphabetical_8c.html#af1f9b6eb320d872ba0766dc8bd070075">closeFile</a></div><div class="ttdeci">void closeFile(FILE *file)</div><div class="ttdoc">Closes the file after reading or writing.</div><div class="ttdef"><b>Definition:</b> words_alphabetical.c:90</div></div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="100%" height="472"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a22516c70583c9fa78e4edffb063836cc" name="a22516c70583c9fa78e4edffb063836cc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a22516c70583c9fa78e4edffb063836cc">◆ </a></span>writeContentOfTreeToFile()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void writeContentOfTreeToFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td>
|
|
<td class="paramname"><em>node</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">FILE * </td>
|
|
<td class="paramname"><em>file</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Writes contents of tree to another file alphabetically. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">node</td><td>pointer to current node </td></tr>
|
|
<tr><td class="paramname">file</td><td>pointer to file </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
|
<p>< for word numbering in the write file</p>
|
|
<div class="fragment"><div class="line"><span class="lineno"> 122</span>{</div>
|
|
<div class="line"><span class="lineno"> 123</span> <span class="keyword">static</span> uint64_t i = 1; <span class="comment">///< for word numbering in the write file</span></div>
|
|
<div class="line"><span class="lineno"> 124</span> <span class="keywordflow">if</span> (<a class="code hl_struct" href="../../d5/da1/structnode.html">node</a> != NULL) <span class="comment">// checks if the node is valid</span></div>
|
|
<div class="line"><span class="lineno"> 125</span> {</div>
|
|
<div class="line"><span class="lineno"> 126</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc">writeContentOfTreeToFile</a>(</div>
|
|
<div class="line"><span class="lineno"> 127</span> <a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>-><a class="code hl_variable" href="../../d5/da1/structnode.html#af7109e6ffd82cbbb705e486fd0ce92f0">left</a>,</div>
|
|
<div class="line"><span class="lineno"> 128</span> file); <span class="comment">// calls `writeContentOfTreeToFile` for left sub tree</span></div>
|
|
<div class="line"><span class="lineno"> 129</span> fprintf(file, <span class="stringliteral">"%-5lu \t %-9lu \t %s \n"</span>, i++, <a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>->frequency,</div>
|
|
<div class="line"><span class="lineno"> 130</span> <a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>->word); <span class="comment">// prints the word number, word frequency and word</span></div>
|
|
<div class="line"><span class="lineno"> 131</span> <span class="comment">// in tabular format to the file</span></div>
|
|
<div class="line"><span class="lineno"> 132</span> <a class="code hl_function" href="../../d3/d78/words__alphabetical_8c.html#a22516c70583c9fa78e4edffb063836cc">writeContentOfTreeToFile</a>(</div>
|
|
<div class="line"><span class="lineno"> 133</span> <a class="code hl_struct" href="../../d5/da1/structnode.html">node</a>-><a class="code hl_variable" href="../../d5/da1/structnode.html#a51e160f22dc6064bac4a4f9f1d931c2c">right</a>,</div>
|
|
<div class="line"><span class="lineno"> 134</span> file); <span class="comment">// calls `writeContentOfTreeToFile` for right sub tree</span></div>
|
|
<div class="line"><span class="lineno"> 135</span> }</div>
|
|
<div class="line"><span class="lineno"> 136</span>}</div>
|
|
</div><!-- fragment --><div class="dynheader">
|
|
Here is the call graph for this function:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d3/d78/words__alphabetical_8c_a22516c70583c9fa78e4edffb063836cc_cgraph.svg" width="182" height="60"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="../../dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html">data_structures</a></li><li class="navelem"><a class="el" href="../../dir_e39df94f82619fa5256f1786519937be.html">binary_trees</a></li><li class="navelem"><a class="el" href="../../d3/d78/words__alphabetical_8c.html">words_alphabetical.c</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|