emath
Version:
This is a module for math.
589 lines (117 loc) • 5.59 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Class: stack</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: stack</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>stack<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Data structure: stack</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="stack"><span class="type-signature"></span>new stack<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Init stack
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="dataStruct.js.html">dataStruct.js</a>, <a href="dataStruct.js.html#line9">line 9</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="empty"><span class="type-signature"></span>empty<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
To get the stack is not empty(true or false)
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="dataStruct.js.html">dataStruct.js</a>, <a href="dataStruct.js.html#line47">line 47</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
bool The stack is not empty
</div>
<h4 class="name" id="pop"><span class="type-signature"></span>pop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
To remove the last value of stack
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="dataStruct.js.html">dataStruct.js</a>, <a href="dataStruct.js.html#line31">line 31</a>
</li></ul></dd>
</dl>
<h4 class="name" id="push"><span class="type-signature"></span>push<span class="signature">(value)</span><span class="type-signature"></span></h4>
<div class="description">
To push value
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">anyType</span>
</td>
<td class="description last">The value of you want to pushed the value</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="dataStruct.js.html">dataStruct.js</a>, <a href="dataStruct.js.html#line39">line 39</a>
</li></ul></dd>
</dl>
<h4 class="name" id="top"><span class="type-signature"></span>top<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
To get the top value of stack
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="dataStruct.js.html">dataStruct.js</a>, <a href="dataStruct.js.html#line24">line 24</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
number The top value of stack
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="priority_queue.html">priority_queue</a></li><li><a href="queue.html">queue</a></li><li><a href="stack.html">stack</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Aug 13 2018 15:55:25 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>