This class will be recorded! Its use is limited to members of the class. Please do not share with others.
Approximate overview
A Facebook posting from an alum I love (and I love them even when they are critical of me).
Five years ago I finished my first computer science course. I got a D or an F (see? you won’t remember one day) on my first test and came back with an A. Before that, I was told that I couldn’t be an engineer because I was poor, not a boy, didn’t have a computer, etc. I’ve failed countless interviews, and had lots of blunders. Now I’m working at Spotify as a software engineer and doing well. I didn’t do well my first round of evaluations, but I got promoted the next.
I’m mostly here thinking out loud that for every success there’re 1000s of mistakes. I’m striving to learn to be ok with doing things 70% perfectly, instead of obsessing over what I didn’t do right.
And some followup notes.
and i mean still struggling! every day!
but better than to not try at all
and seriously i was so confused…
recursion didn’t really make sensee to me for a long time
and i hate the kybord on my mac
Normal notes
Info:
Activities
Mini Projects
Readings
Quizzes
Other
Any order for experiments?
Fun ones on top.
Could we go over the traversals?
; Sam predicts: a b d c f h g e for postorder
(define flatten-preorder
(lambda (t)
(if (empty-tree? t)
null
(append (list (btt t))
(flatten-preorder (btl t))
(flatten-preorder (btr t))))))
(define flatten-inorder
(lambda (t)
(if (empty-tree? t)
null
(append (flatten-inorder (btl t))
(list (btt t))
(flatten-inorder (btr t))))))
(define flatten-postorder
(lambda (t)
(if (empty-tree? t)
null
(append (flatten-postorder (btl t))
(flatten-postorder (btr t))
(list (btt t))))))
> (define sample-tree (vector->tree (vector "a" "b" "c" "d" "e" "f" "g" "h")))
> sample-tree
'("e" ("c" ("b" ("a" ◬ ◬) ◬) ("d" ◬ ◬)) ("g" ("f" ◬ ◬) ("h" ◬ ◬)))
> (display-binary-tree sample-tree)
⦿ e
● c
▶ b
▪ a
▶ d
● g
▶ f
▶ h
> (flatten-postorder sample-tree)
'("a" "b" "d" "c" "f" "h" "g" "e")
> (flatten-inorder sample-tree)
'("a" "b" "c" "d" "e" "f" "g" "h")
> (flatten-preorder sample-tree)
'("e" "c" "b" "a" "d" "g" "f" "h")
Is there a general pattern for tree recursion?
(define tree-proc
(lambda (t)
(if (empty-tree? t)
*BASE-CASE*
(*COMBINE* (*PROCESS* (btt t))
(tree-proc (btl t))
(tree-proc (btr t))))))
Will we get SoLA 3 back before we take SoLA 4?
Yes. As soon as I can?
What is that number in the lower-right-hand corner?
I have no idea.
When am I getting redo grades?
Um. Soon.
You know the drill.
Agh! So many problems.