Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use thead/tbody + row headers #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 35 additions & 32 deletions Tables.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h2 id="data-structures">Common Data Structure Operations</h2>
<table class="table table-bordered table-striped">

<thead>
<tr>
<th>Data Structure</th>
<th colspan="8">Time Complexity</th>
Expand All @@ -24,9 +24,10 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<th>Deletion</th>
<th></th>
</tr>

</thead>
<tbody>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Array_data_structure">Array</a></td>
<th><a href="http://en.wikipedia.org/wiki/Array_data_structure">Array</a></th>
<td><code class="green">&Theta;(1)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
Expand All @@ -38,7 +39,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Stack_(abstract_data_type)">Stack</a></td>
<th><a href="http://en.wikipedia.org/wiki/Stack_(abstract_data_type)">Stack</a></th>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="green">&Theta;(1)</code></td>
Expand All @@ -50,7 +51,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Queue_(abstract_data_type)">Queue</a></td>
<th><a href="http://en.wikipedia.org/wiki/Queue_(abstract_data_type)">Queue</a></th>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="green">&Theta;(1)</code></td>
Expand All @@ -62,7 +63,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Singly_linked_list#Singly_linked_lists">Singly-Linked List</a></td>
<th><a href="http://en.wikipedia.org/wiki/Singly_linked_list#Singly_linked_lists">Singly-Linked List</a></th>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="green">&Theta;(1)</code></td>
Expand All @@ -74,7 +75,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Doubly_linked_list">Doubly-Linked List</a></td>
<th><a href="http://en.wikipedia.org/wiki/Doubly_linked_list">Doubly-Linked List</a></th>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="yellow">&Theta;(n)</code></td>
<td><code class="green">&Theta;(1)</code></td>
Expand All @@ -86,7 +87,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Skip_list">Skip List</a></td>
<th><a href="http://en.wikipedia.org/wiki/Skip_list">Skip List</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -98,7 +99,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="orange">O(n log(n))</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Hash_table">Hash Table</a></td>
<th><a href="http://en.wikipedia.org/wiki/Hash_table">Hash Table</a></th>
<td><code class="gray">N/A</code></td>
<td><code class="green">&Theta;(1)</code></td>
<td><code class="green">&Theta;(1)</code></td>
Expand All @@ -110,7 +111,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Binary_search_tree">Binary Search Tree</a></td>
<th><a href="http://en.wikipedia.org/wiki/Binary_search_tree">Binary Search Tree</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -122,7 +123,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="https://en.wikipedia.org/wiki/Cartesian_tree">Cartesian Tree</a></td>
<th><a href="https://en.wikipedia.org/wiki/Cartesian_tree">Cartesian Tree</a></th>
<td><code class="gray">N/A</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -134,7 +135,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/B_tree">B-Tree</a></td>
<th><a href="http://en.wikipedia.org/wiki/B_tree">B-Tree</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -146,7 +147,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Red-black_tree">Red-Black Tree</a></td>
<th><a href="http://en.wikipedia.org/wiki/Red-black_tree">Red-Black Tree</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -158,7 +159,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="https://en.wikipedia.org/wiki/Splay_tree">Splay Tree</a></td>
<th><a href="https://en.wikipedia.org/wiki/Splay_tree">Splay Tree</a></th>
<td><code class="gray">N/A</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -170,7 +171,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/AVL_tree">AVL Tree</a></td>
<th><a href="http://en.wikipedia.org/wiki/AVL_tree">AVL Tree</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -182,7 +183,7 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/K-d_tree">KD Tree</a></td>
<th><a href="http://en.wikipedia.org/wiki/K-d_tree">KD Tree</a></th>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
<td><code class="yellow-green">&Theta;(log(n))</code></td>
Expand All @@ -193,11 +194,12 @@ <h2 id="data-structures">Common Data Structure Operations</h2>
<td><code class="yellow">O(n)</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>

</tbody>
</table>

<h2 id="sorting">Array Sorting Algorithms</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Algorithm</th>
<th colspan="3">Time Complexity</th>
Expand All @@ -210,97 +212,98 @@ <h2 id="sorting">Array Sorting Algorithms</h2>
<th>Worst</th>
<th>Worst</th>
</tr>

</thead>
<tbody>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Quicksort">Quicksort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Quicksort">Quicksort</a></th>
<td><code class="orange">&Omega;(n log(n))</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="yellow-green">O(log(n))</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Merge_sort">Mergesort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Merge_sort">Mergesort</a></th>
<td><code class="orange">&Omega;(n log(n))</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="orange">O(n log(n))</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Timsort">Timsort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Timsort">Timsort</a></th>
<td><code class="yellow">&Omega;(n)</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="orange">O(n log(n))</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Heapsort">Heapsort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Heapsort">Heapsort</a></th>
<td><code class="orange">&Omega;(n log(n))</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="orange">O(n log(n))</code></td>
<td><code class="green">O(1)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble Sort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Bubble_sort">Bubble Sort</a></th>
<td><code class="yellow">&Omega;(n)</code></td>
<td><code class="red">&Theta;(n^2)</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="green">O(1)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Insertion_sort">Insertion Sort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Insertion_sort">Insertion Sort</a></th>
<td><code class="yellow">&Omega;(n)</code></td>
<td><code class="red">&Theta;(n^2)</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="green">O(1)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Selection_sort">Selection Sort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Selection_sort">Selection Sort</a></th>
<td><code class="red">&Omega;(n^2)</code></td>
<td><code class="red">&Theta;(n^2)</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="green">O(1)</code></td>
</tr>
<tr>
<td><a href="https://en.wikipedia.org/wiki/Tree_sort">Tree Sort</a></td>
<th><a href="https://en.wikipedia.org/wiki/Tree_sort">Tree Sort</a></th>
<td><code class="orange">&Omega;(n log(n))</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/Shellsort">Shell Sort</a></td>
<th><a href="http://en.wikipedia.org/wiki/Shellsort">Shell Sort</a></th>
<td><code class="orange">&Omega;(n log(n))</code></td>
<td><code class="red">&Theta;(n(log(n))^2)</code></td>
<td><code class="red">O(n(log(n))^2)</code></td>
<td><code class="green">O(1)</code></td>
</tr>
<tr>
<td><a rel="tooltip" title="Only for integers. k is a number of buckets" href="http://en.wikipedia.org/wiki/Bucket_sort">Bucket Sort</a></td>
<th><a rel="tooltip" title="Only for integers. k is a number of buckets" href="http://en.wikipedia.org/wiki/Bucket_sort">Bucket Sort</a></th>
<td><code class="green">&Omega;(n+k)</code></td>
<td><code class="green">&Theta;(n+k)</code></td>
<td><code class="red">O(n^2)</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>
<tr>
<td><a rel="tooltip" title="Constant number of digits 'k'" href="http://en.wikipedia.org/wiki/Radix_sort">Radix Sort</a></td>
<th><a rel="tooltip" title="Constant number of digits 'k'" href="http://en.wikipedia.org/wiki/Radix_sort">Radix Sort</a></th>
<td><code class="green">&Omega;(nk)</code></td>
<td><code class="green">&Theta;(nk)</code></td>
<td><code class="green">O(nk)</code></td>
<td><code class="yellow">O(n+k)</code></td>
</tr>
<tr>
<td><a rel="tooltip" title="Difference between maximum and minimum number 'k'" href="https://en.wikipedia.org/wiki/Counting_sort">Counting Sort</a></td>
<th><a rel="tooltip" title="Difference between maximum and minimum number 'k'" href="https://en.wikipedia.org/wiki/Counting_sort">Counting Sort</a></th>
<td><code class="green">&Omega;(n+k)</code></td>
<td><code class="green">&Theta;(n+k)</code></td>
<td><code class="green">O(n+k)</code></td>
<td><code class="yellow">O(k)</code></td>
</tr>
<tr>
<td><a href="https://en.wikipedia.org/wiki/Cubesort">Cubesort</a></td>
<th><a href="https://en.wikipedia.org/wiki/Cubesort">Cubesort</a></th>
<td><code class="yellow">&Omega;(n)</code></td>
<td><code class="orange">&Theta;(n log(n))</code></td>
<td><code class="orange">O(n log(n))</code></td>
<td><code class="yellow">O(n)</code></td>
</tr>

</tbody>
</table>