Skip to content

Commit 123a88e

Browse files
committed
update
1 parent 3dd34bb commit 123a88e

31 files changed

+113084
-0
lines changed

img/bash.gif

361 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>SUMMARY</title>
8+
<style type="text/css">
9+
code{white-space: pre-wrap;}
10+
span.smallcaps{font-variant: small-caps;}
11+
span.underline{text-decoration: underline;}
12+
div.column{display: inline-block; vertical-align: top; width: 50%;}
13+
</style>
14+
</head>
15+
<body>
16+
<h1 id="table-of-contents">Table of contents</h1>
17+
<ul>
18+
<li><a href="README.md">Wiki</a></li>
19+
</ul>
20+
</body>
21+
</html>

steps/7-recursive-run/markdown/TREE.html

Lines changed: 3147 additions & 0 deletions
Large diffs are not rendered by default.

steps/7-recursive-run/markdown/blueprint.html

Lines changed: 8715 additions & 0 deletions
Large diffs are not rendered by default.

steps/7-recursive-run/markdown/data-structures.html

Lines changed: 1432 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>deque</title>
8+
<style type="text/css">
9+
code{white-space: pre-wrap;}
10+
span.smallcaps{font-variant: small-caps;}
11+
span.underline{text-decoration: underline;}
12+
div.column{display: inline-block; vertical-align: top; width: 50%;}
13+
</style>
14+
</head>
15+
<body>
16+
<h1 id="deque">Deque</h1>
17+
<h3 id="projected-time">Projected Time</h3>
18+
<p>80 minutes</p>
19+
<h3 id="prerequisites">Prerequisites</h3>
20+
<ul>
21+
<li><a href="/data-structures/intro-to-data-structures.md">Intro to Data Structures</a></li>
22+
<li><a href="/javascript/javascript-1-variables.md">JavaScript 1 - Variables, Strings, Numbers</a></li>
23+
<li><a href="/javascript/javascript-2-arrays-functions.md">JavaScript 2 - Arrays, Functions</a></li>
24+
<li><a href="/javascript/javascript-3-conditionals.md">JavaScript 3 - Conditionals, Comparisons, Booleans</a></li>
25+
<li><a href="/javascript/javascript-4-loops.md">JavaScript 4 - Loops</a></li>
26+
<li><a href="/javascript/javascript-5-switch.md">JavaScript 5 - Switch Statements</a></li>
27+
<li><a href="/javascript/javascript-6-object-literals.md">JavaScript 6 - Object Literals</a></li>
28+
<li><a href="/javascript/javascript-7-oop.md">JavaScript 7 - Object-Oriented Programming</a></li>
29+
<li><a href="/runtime-complexity/runtime-complexity.md">Runtime Complexity</a></li>
30+
</ul>
31+
<h3 id="motivation">Motivation</h3>
32+
<p>Deque is used as an abstract data type, also referenced as a double-ended queue. Similar to a queue, deques exist as an ordered collection of items. A deque’s nature is unrestrictive, meaning that it easily allows for adding and removing items at either end. Deques are a unique hybrid linear structure that provide the capabilities of stacks and queues in a unique data structure. Deques can be implemented with a dynamic array or with a doubly-linked list and they do not require Last In First Out (LIFO) or First In First Out (FIFO)orderings that are required by both stacks and queues. The homophone “dequeue” is used as a verb, meaning to remove from a queue.</p>
33+
<p>Examples that use Deque:</p>
34+
<ul>
35+
<li>A nice application of the deque is storing a web browser’s history. Recently visited URLs are added to the front of the deque, and the URL at the back of the deque is removed after some specified number of insertions at the front.</li>
36+
<li>Another common application of the deque is storing a software application’s list of undo operations.</li>
37+
<li>One example where a deque can be used is the A-Steal job scheduling algorithm. This algorithm implements task scheduling for several processors. A separate deque with threads to be executed is maintained for each processor. <a href="https://www.quora.com/What-are-some-of-the-real-life-application-of-Deque">(by Atishay Jain)</a></li>
38+
</ul>
39+
<h3 id="objectives">Objectives</h3>
40+
<p><strong>Participants will be able to:</strong></p>
41+
<ul>
42+
<li>Understand when to use a deque</li>
43+
<li>Be familiar with common methods</li>
44+
<li>Implement a deque</li>
45+
<li>Find and use a deque library</li>
46+
<li>Discern performance tradeoffs for different implementations of a deque</li>
47+
</ul>
48+
<h3 id="specific-things-to-learn">Specific Things to Learn</h3>
49+
<ul>
50+
<li>Properties of a deque</li>
51+
<li>Common use cases for deque</li>
52+
<li>Review of common implementation(s)</li>
53+
</ul>
54+
<h3 id="materials">Materials</h3>
55+
<ul>
56+
<li><a href="https://www.geeksforgeeks.org/deque-set-1-introduction-applications/">Deque Geeks for Geeks</a></li>
57+
<li><a href="https://www.youtube.com/watch?v=kLBuJ1Hle8g">Deque Data Structure</a> - 7 minute video</li>
58+
<li><a href="https://youtu.be/IITnvmnfi_Y">Stacks, Queues, &amp; Double Ended Queues</a> - 6 minute video</li>
59+
</ul>
60+
<h3 id="lesson">Lesson</h3>
61+
<p>Review content from slides (TODO: add link here when available).</p>
62+
<h3 id="common-mistakes-misconceptions">Common Mistakes / Misconceptions</h3>
63+
<ul>
64+
<li>There may be an implementation that is very simple, but untenable for larger deques.</li>
65+
</ul>
66+
<h3 id="guided-practice">Guided Practice</h3>
67+
<p>Discuss as a group how a deque differs from other data structures already reviewed. Some suggested questions to consider:</p>
68+
<ul>
69+
<li>What are the methods a deque must have?</li>
70+
<li>What can be tracked in a deque?</li>
71+
<li>When would a deque be used?</li>
72+
<li>What other data structures are used to make a deque?</li>
73+
</ul>
74+
<h3 id="independent-practice">Independent Practice</h3>
75+
<p>Implement a deque in JavaScript, keeping in mind all methods and helper methods that define a deque. Consider performance – what happens as you call specific methods you’ve defined?</p>
76+
<h3 id="challenge">Challenge</h3>
77+
<p>There are many different ways to implement a deque in any language. Implement a deque a different way from what you did before, then consider how it differs. Is this second implementation better? If you get stuck, check out StackOverflow comments!</p>
78+
<h3 id="check-for-understanding">Check for Understanding</h3>
79+
<p>Find another person in the cohort and discuss:</p>
80+
<ul>
81+
<li>What are some of the of the advantages/ disadvantages of using deques?</li>
82+
<li>In a language of your choice, can you implement some of the basic operations a deque must perform?</li>
83+
<li>Having implemented queues and stacks, can you identify situations where deques are a better data structure to use?</li>
84+
</ul>
85+
<h3 id="additional-reading">Additional Reading</h3>
86+
<p>A-Steal Job Scheduling was briefly mentioned in the lesson as a use of deques. You can <a href="http://supertech.csail.mit.edu/papers/steal.pdf">read more here</a>.</p>
87+
</body>
88+
</html>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>hash-tables</title>
8+
<style type="text/css">
9+
code{white-space: pre-wrap;}
10+
span.smallcaps{font-variant: small-caps;}
11+
span.underline{text-decoration: underline;}
12+
div.column{display: inline-block; vertical-align: top; width: 50%;}
13+
</style>
14+
</head>
15+
<body>
16+
<h1 id="hash-tables">Hash Tables</h1>
17+
<h3 id="projected-time">Projected Time</h3>
18+
<p>About 2 hours and 30 minutes</p>
19+
<ul>
20+
<li>60 mins Lesson</li>
21+
<li>30 mins Independent Practice</li>
22+
<li>30 mins Check for Understanding</li>
23+
</ul>
24+
<h3 id="prerequisites">Prerequisites</h3>
25+
<ul>
26+
<li><a href="../javascript/javascript-7-oop.md">JavaScript prototypal inheritance</a></li>
27+
<li><a href="../runtime-complexity/runtime-complexity.md">Runtime complexity</a></li>
28+
</ul>
29+
<h3 id="motivation">Motivation</h3>
30+
<p>Hash tables are one of the most frequently used data structures. You’ll use them in your code a lot, so knowing how and when to use hash tables is important.</p>
31+
<p>Knowing how hash tables work will give you a deeper understanding of why hash tables are used and what they’re good for. Hash tables are also often used in the solution to interview questions.</p>
32+
<p>Uses of Hashing:</p>
33+
<ul>
34+
<li>Authentication - Cryptographic hash functions let you log in to a system without storing your password anywhere vulnerable.</li>
35+
<li>Search - Hashing is useful for indexing large storage spaces, so that you can look things up in them without reading their entire contents every time. Developers usually do the indexing of big data sets to reduce the time of processing operations over them.</li>
36+
<li>Programming languages - Hash tables are a convenient way to implement the mechanism that connects a variable’s name to its memory location. <a href="https://www.quora.com/What-are-the-real-world-examples-for-hashing">(quora.com)</a></li>
37+
</ul>
38+
<h3 id="objectives">Objectives</h3>
39+
<ul>
40+
<li>Understand basic hashing algorithms</li>
41+
<li>Know the runtime of hash table operations</li>
42+
<li>Be able to identify problems where hash tables could be used</li>
43+
<li>Be able to write code that uses hash tables to solve problems</li>
44+
<li>Understand how hash tables are implemented and how this implementation leads to the runtime properties</li>
45+
</ul>
46+
<h3 id="specific-things-to-learn">Specific Things to Learn</h3>
47+
<ul>
48+
<li>A hash table is used to store key-value pairs or tuples.</li>
49+
<li>Why is this called a hash table? The hash of the key determines where the value is stored.</li>
50+
<li>All objects in JavaScript are hash tables.</li>
51+
<li>Look-up in a hash table is on average O(1). Worst case look-up is O(n).</li>
52+
<li>Using different hashing algorithms on the keys will affect the hash table’s performance.</li>
53+
</ul>
54+
<h3 id="materials">Materials</h3>
55+
<ul>
56+
<li><a href="https://docs.google.com/presentation/d/1V9liCnncXJDXZ0CK_MbXfFrWz6cwGucTYdIkHdkJ9_8/edit#slide=id.p">Understanding and Using Hash Tables Slides</a></li>
57+
<li><a href="https://docs.google.com/presentation/d/1-zCx1fc5cUP6rklL-CrYzmO8ibcXztsOZxJUv3Fpd-s/edit#slide=id.g2f6e14aaa5_0_0">Implementing Hash Tables Slides</a></li>
58+
</ul>
59+
<h3 id="lesson">Lesson</h3>
60+
<ul>
61+
<li>Read through lesson slides <a href="https://docs.google.com/presentation/d/1V9liCnncXJDXZ0CK_MbXfFrWz6cwGucTYdIkHdkJ9_8/edit#slide=id.p">Understanding and Using Hash Tables</a></li>
62+
<li>Read through lesson slides <a href="https://docs.google.com/presentation/d/1-zCx1fc5cUP6rklL-CrYzmO8ibcXztsOZxJUv3Fpd-s/edit#slide=id.g2f6e14aaa5_0_0">Implementing Hash Tables</a></li>
63+
</ul>
64+
<h3 id="common-mistakes-misconceptions">Common Mistakes / Misconceptions</h3>
65+
<ul>
66+
<li>When should I use an array instead of a hash table? If your keys are sequential integers.</li>
67+
</ul>
68+
<h3 id="preamble">Preamble</h3>
69+
<p>Languages call this type of data structure by many names:</p>
70+
<ul>
71+
<li>ES2015 JS calls it a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a> but historically, since all Objects allow lookup by property name, folks just used plain <code>Object</code></li>
72+
<li>Python calls it a <a href="https://realpython.com/python-dicts/"><code>Dict</code></a> for Dictionary since you look it up by a key, just like a dictionary’s have an index for each letter</li>
73+
<li>Java calls is a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html"><code>HashMap</code></a> or <code>Hashtable</code></li>
74+
<li>Ruby calls it a <a href="https://ruby-doc.org/core-2.7.0/Hash.html"><code>Hash</code></a></li>
75+
</ul>
76+
<h3 id="guided-practice">Guided Practice</h3>
77+
<p>Let’s understand how to make hash maps using JavaScript.</p>
78+
<ul>
79+
<li><a href="https://reactgo.com/hashtable-javascript/">How to implement hash table in javascript</a></li>
80+
<li>Here is the link for the video on <a href="https://www.youtube.com/watch?v=VundFD_ccgE">how to make hash tables using JavaScripts</a>.</li>
81+
<li>The another link for what hash tables are and how to implement them is <a href="https://www.hackerearth.com/practice/data-structures/hash-tables/basics-of-hash-tables/tutorial/">Basics of Hash Tables</a>. It contains the code for how <em>different types of hashing</em> can be done by <em>coding</em> in JS. The apprentices should be able to code different type of hashtables like linear probing, quadratic probing etc. They can start tutorial where coding begins provided that they know the basics of hashing.</li>
82+
</ul>
83+
<h3 id="independent-practice">Independent Practice</h3>
84+
<h4 id="coding-questions-that-use-hash-tables">Coding questions that use hash tables</h4>
85+
<ul>
86+
<li>A person is represented in a JSON string, and the person’s <code>name</code> is specified. Say hello to this person.</li>
87+
</ul>
88+
<h4 id="implement-a-hash-table">Implement a hash table</h4>
89+
<p>Basics: set(), get(), print() Challenge 1: Handle collisions with chaining Challenge 2: Make the table larger when enough items are added to the table</p>
90+
<h3 id="challenge">Challenge</h3>
91+
<p>Compare implementations of bucket collisions with a peer. Brainstorm different data structures one can use for implementing buckets. Code review others’ hash table implementations: Are clear parameter and method names used? Is the code DRY? Compare hashing algorithm choices with a peer.</p>
92+
<h3 id="check-for-understanding">Check for Understanding</h3>
93+
<ul>
94+
<li>Explain how a hash table uses hashing.</li>
95+
<li>What is a real-world use case for a hash table? What are the advantages?</li>
96+
</ul>
97+
<h3 id="supplemental-materials">Supplemental Materials</h3>
98+
<ul>
99+
<li><a href="https://medium.freecodecamp.org/how-to-implement-a-simple-hash-table-in-javascript-cb3b9c1f2997">How to implement simple hash table?</a></li>
100+
<li><a href="http://www.mojavelinux.com/articles/javascript_hashes.html">Hash Tables in JavaScript</a></li>
101+
<li><a href="https://codeburst.io/objects-and-hash-tables-in-javascript-a472ad1940d9">Objects and Hash Tables in JavaScript</a></li>
102+
<li><a href="https://medium.com/javascript-in-plain-english/algorithm-in-javascript-hash-table-7b0464d2b81b">Algorithms in JavaScript: Hash Tables</a></li>
103+
</ul>
104+
</body>
105+
</html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy