Skip to content

Instantly share code, notes, and snippets.

@kgashok
Created February 23, 2017 18:30
Show Gist options
  • Select an option

  • Save kgashok/02722bbc69c65fa8997e40b362f21cde to your computer and use it in GitHub Desktop.

Select an option

Save kgashok/02722bbc69c65fa8997e40b362f21cde to your computer and use it in GitHub Desktop.
adtSummary.md
<h1 id="types-of-data-structures">Types Of Data Structures</h1>
<ul>
<li>Primitive data structures</li>
<li>Non-primitive data structures</li>
</ul>
<hr>
<h2 id="primitive-and-non-primitive-data-structures">Primitive and Non-primitive data structures</h2>
<h3 id="primitive-data-structures">Primitive Data Structures</h3>
<p>Primitive Data Structures are the basic data structures that directly operate upon the machine instructions.</p>
<p>They have different representations on different computers. <br>
<code>Integers</code>, <code>Floating point numbers</code>, <code>Character constants</code>, <code>String constants</code> and <code>Pointers</code> come under this category.</p>
<h3 id="non-primitive-data-structures">Non-primitive Data Structures</h3>
<p>Non-primitive data structures are more complicated data structures and are derived from primitive data structures.</p>
<p>They emphasize on grouping same or different data items with relationship between each data item. </p>
<p><code>Arrays</code>, <code>Lists</code> and <code>Files</code> come under this category.</p>
<hr>
<p><img src="https://drive.google.com/uc?id=0Bwu4iGPfYEufaEFzVUZhWUNTT1E" alt="Types Of Data Structure.png" title=""></p>
<h3 id="adt">ADT</h3>
<p>An Abstract Data Type (ADT) is implemented as either linear or non-linear data structures with specific functions that operate on data structure elements. <br>
<img src="http://www.sqa.org.uk/e-learning/LinkedDS01CD/images/pic002.jpg" alt="" title=""></p>
<p>An ADT’s usage and implementation choice is based on the application in which the ADT is going to be used to achieve a specific purpose.</p>
<p><img src="https://drive.google.com/uc?id=0Bwu4iGPfYEufeG9tekFvQThLbHc" alt="ASI" title=""></p>
<table>
<thead>
<tr>
<th>Specification</th>
<th>List ADT</th>
<th>Stack ADT</th>
<th>Queue ADT</th>
<th>Tree ADT (PDS-2)</th>
</tr>
</thead>
<tbody><tr>
<td><em>Implementation</em></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>linear (array)_</td>
<td><code>int mylist[50];</code></td>
<td><code>#define MAX 40; char stack[MAX];</code></td>
<td>array-based queue</td>
<td>-</td>
</tr>
<tr>
<td><em>non-linear (linked data)</em></td>
<td>linked list</td>
<td>linked-list based stack</td>
<td>linked-list based queue</td>
<td>-</td>
</tr>
<tr>
<td><em>non-linear (linked data)</em></td>
<td>circular linked list</td>
<td>-</td>
<td>circular queue</td>
<td>-</td>
</tr>
<tr>
<td><em>non-linear (linked data)</em></td>
<td>doubly linked list</td>
<td>-</td>
<td>double-ended queue</td>
<td>-</td>
</tr>
<tr>
<td>typical operations (aka functions)</td>
<td><code>insert</code>, <code>delete</code>, <code>merge</code>, <code>traverse</code></td>
<td><code>push</code>, <code>pop</code>, <code>peek</code>, <code>isEmpty</code></td>
<td><code>enqueue</code>, <code>dequeue</code></td>
<td><code>bfs</code>, <code>dfs</code></td>
</tr>
<tr>
<td>typical applications</td>
<td>data processing / manipulation</td>
<td>arithmetic expression evaluation, function calls in operating system</td>
<td>printer spooling</td>
<td>data storage and retrieval (mobile phone book search)</td>
</tr>
</tbody></table>
<h3 id="commentary">Commentary</h3>
<ul>
<li>Known to Unknown (primitive to non-primitive) </li>
<li>“A picture is worth a 1000 words” </li>
<li>Tabulation provides context for the various options </li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment