Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 865c6e0

Browse files
authoredMay 22, 2018
Merge pull request #4 from caleybrock/master
Class 3 slides
2 parents 17edee8 + 996b009 commit 865c6e0

6 files changed

+228
-1180
lines changed
 

‎algorithms/class1.html

-21
Original file line numberDiff line numberDiff line change
@@ -678,27 +678,6 @@ <h3>What is the time complexity of...</h3>
678678
<p>O(n<sup>2</sup>) - Quadratic</p>
679679
</section>
680680

681-
<!-- to do: time content to see if we should add data structures here-->
682-
<!--
683-
<section>
684-
<h2>More data structures</h2>
685-
<h3>Example: Dictionaries/ Objects/ Hash Maps/ Maps</h3>
686-
<div style="float: left; width: 50%">
687-
<img src="images/hash-table.png">
688-
</div>
689-
<div style="float: left; width: 50%">
690-
<pre class="fragment"><code>
691-
myObject = { key : value,
692-
key : value,
693-
key : value }
694-
</code>
695-
</pre>
696-
</div>
697-
</section>
698-
-->
699-
700-
<!-- to do: add questions about hash map lookup and other data structures -->
701-
702681

703682
<!-- START OF SPACE COMPLEXITY -->
704683
<section>

‎algorithms/class3.html

+101-1,149
Large diffs are not rendered by default.

‎algorithms/index.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="utf-8">
66

7-
<title>Intro to Algorithms</title>
7+
<title>CS Fundamentals</title>
88

99
<meta name="description" content="">
1010
<meta name="author" content="Pamela Fox">
@@ -58,11 +58,10 @@
5858
<!-- Opening slide -->
5959
<section>
6060
<img src = "../common/img/circle-gdi-logo.png">
61-
<h3>Computer Science Fundementals</h3>
61+
<h3>Computer Science Fundamentals</h3>
6262
<a href="class1.html">Class 1</a>
6363
<a href="class2.html">Class 2</a>
6464
<a href="class3.html">Class 3</a>
65-
<a href="class4.html">Class 4</a>
6665
</section>
6766
</div>
6867
</div>
@@ -82,9 +81,9 @@ <h3>Schedule</h3>
8281
Sorting (Selection, Insert, Bucket, Bubble, Merge)
8382

8483
Class 3
85-
Review time and space complexity
8684
Data structures - dictionaries
8785
Algorithms with dictionaries
86+
Interview practice
8887
</pre></code>
8988
</section>
9089
<section>

‎algorithms/letter_count_exercise.html

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
6+
</head>
7+
<body>
8+
<div class="container">
9+
<h2>Letter count Exercise</h2>
10+
<h3>Write a function that counts how many of each English letters appears in a string</h3>
11+
<ul>
12+
<li>Pair up!</li>
13+
<li>Write pseudocode for this problem!</li>
14+
<li>Now write the code for this algorithm. You can use <a href="http://repl.it">repl.it</a> or some other environment to run and test code.</li>
15+
<li>The function you write should accept a string as its parameter. The function should print out a letter count for each letter.</li>
16+
</ul>
17+
<br>
18+
Stumped? <a onclick="showHints()">Click here</a> for some hints
19+
<br>
20+
<div id="hints" style="display:none;"">
21+
<ol>
22+
<li>Try using a dictionary!</li>
23+
</ol>
24+
</div>
25+
<br>
26+
<button onclick='showSolution()'>See solution</button>
27+
<br>
28+
<div id="solution" style="display:none;">
29+
<pre>
30+
import string
31+
def LetterCount(str):
32+
str= str.lower().strip()
33+
str = str.strip(string.punctuation)
34+
list1=list(str)
35+
lcDict= {}
36+
for l in list1:
37+
if l.isalpha():
38+
if l in lcDict:
39+
lcDict[l] +=1
40+
else:
41+
lcDict[l]= 1
42+
print lcDict
43+
44+
LetterCount("Abracadabra there it is!")
45+
</pre>
46+
47+
<a href="https://stackoverflow.com/questions/5664494/letter-count-dictionary?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa">Stack overflow source</a>
48+
</div>
49+
50+
<script>
51+
52+
function showSolution() {
53+
if (confirm('You surrrrre?')) {
54+
document.getElementById('solution').style.display = 'block';
55+
}
56+
}
57+
58+
function showHints() {
59+
document.getElementById('hints').style.display = 'block';
60+
}
61+
</script>
62+
63+
</body>
64+
</html>

‎algorithms/recursion_exercise.html

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
6+
</head>
7+
<body>
8+
<div class="container">
9+
<h2>Adding up all numbers in a list</h2>
10+
<ul>
11+
<li>Pair up!</li>
12+
<li>Write pseudocode for this problem!</li>
13+
<li>Now write the code for this algorithm. You can use <a href="http://repl.it">repl.it</a> or some other environment to run and test code.</li>
14+
<li>The function you write should accept an array as its parameter. The function should return the total value of all the integers in the array.</li>
15+
</ul>
16+
<br>
17+
Stumped? <a onclick="showHints()">Click here</a> for some hints
18+
<br>
19+
<div id="hints" style="display:none;"">
20+
<ol>
21+
<li>Try solving the first part of the problem and adding it to the rest.</li>
22+
</ol>
23+
</div>
24+
<br>
25+
<button onclick='showSolution()'>See solution</button>
26+
<br>
27+
<div id="solution" style="display:none;">
28+
<pre>
29+
def getSum(piece):
30+
if len(piece)==0:
31+
return 0
32+
else:
33+
return piece[0] + getSum(piece[1:])
34+
print getSum([1, 3, 4, 2, 5])
35+
</pre>
36+
37+
<a href="https://stackoverflow.com/questions/35194767/python-get-sum-of-a-list-of-numbers-with-recursion?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa">Stack overflow source</a>
38+
</div>
39+
40+
<script>
41+
42+
function showSolution() {
43+
if (confirm('You surrrrre?')) {
44+
document.getElementById('solution').style.display = 'block';
45+
}
46+
}
47+
48+
function showHints() {
49+
document.getElementById('hints').style.display = 'block';
50+
}
51+
</script>
52+
53+
</body>
54+
</html>

‎index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 class="page-header">
1313

1414
<a href="https://www.girldevelopit.com/chapters/seattle"><img src="common/img/circle-gdi-logo.png" class="gdilogo-small" alt="Girl Develop It Seattle logo" /></a>
1515

16-
<a href="https://www.girldevelopit.com/chapters/seattle">Girl Develop It Seattle</a> - Computer Science Fundementals
16+
<a href="https://www.girldevelopit.com/chapters/seattle">Girl Develop It Seattle</a> - Computer Science Fundamentals
1717
</h1>
1818

1919
<p>
@@ -43,7 +43,7 @@ <h3>Pre-work</h3>
4343
</li>
4444
</ul>
4545
<h2>Class 1: What is an algorithm?</h2>
46-
<p>Algorithms, time complexity, space complecity and Big O Notation. Intro to analyzing arrays.</p>
46+
<p>Algorithms, time complexity, space complexity and Big O Notation. Intro to analyzing arrays.</p>
4747
<ul>
4848
<li><a href="algorithms/class1.html" target="_blank">Class 1 Slides</a></li>
4949
<li><a href="algorithms/class1_homework.html" target="_blank">Class 1 Homework</a></li>
@@ -60,16 +60,16 @@ <h2>Class 2: Searching + Sorting, Linked Lists, Matrices</h2>
6060
</div>
6161

6262
<div class="column">
63-
<h2>Class 3: Dictionaries and Recursion</h2>
63+
<h2>Class 3: Hash maps and interviews</h2>
6464
<ul>
65-
<li><a href="algorithms/class3.html" target="_blank">Class 3 Slides</a> - not yet complete</li>
65+
<li><a href="algorithms/class3.html" target="_blank">Class 3 Slides</a></li>
6666
</ul>
6767
</div>
6868

6969
<div class="column">
7070
<h2>Additional resources</h2>
7171
<ul>
72-
<li>Ada Developer's Academy <a href="https://github.com/Ada-Developers-Academy/textbook-curriculum/tree/master/04-cs-fundamentals" target="_blank">CS Fundementals Curriculum</a> - much more detailed but approachable curriculum on these same topics</li>
72+
<li>Ada Developer's Academy <a href="https://github.com/Ada-Developers-Academy/textbook-curriculum/tree/master/04-cs-fundamentals" target="_blank">CS Fundamentals Curriculum</a> - much more detailed but approachable curriculum on these same topics</li>
7373
<li><a href="http://bigocheatsheet.com/">Big 0 Cheatsheet</a></li>
7474
<li>Graphs are from <a href="http://arturmeyster.com/time-complexity/#.WvEzLdMvzOQ">this article</a></li>
7575
<li><a href="https://github.com/TechBookHunter/Free-Algorithm-Books/blob/master/book/Grokking%20Algorithms%20-%20An%20illustrated%20guide%20for%20programmers%20and%20other%20curious%20people.pdf">Grokking Algorithms Book</a> in pdf form</li>
@@ -79,7 +79,7 @@ <h2>Additional resources</h2>
7979
</section>
8080
<footer>
8181
<div class="copyright">
82-
CS Fundementals &mdash; Girl Develop It &mdash;
82+
CS Fundamentals &mdash; Girl Develop It &mdash;
8383
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US" target="_blank"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
8484
</div>
8585
</footer>

0 commit comments

Comments
 (0)
Please sign in to comment.