Lecture 6/1: Lecture 24 Q&A


Lecture 24 Questions and Answers (Exported from Zoom Q&A log)

Q: can this be related to blockchain?

A1: Yes!


Q: can we build objects using python?

A1: Yes, python has object-oriented features in the language (class, object, methods, etc.)


Q: where is the 1 coming from for ox and at

A1: It is effectively 26^N power where N is 1 for the first chara and N is 0 for second char


Q: What does minus 'a' do again?

A1: It subtracts the ascii values, effectively computing the ordinal position of the letter within the alphabet


Q: is the “- ‘a’” necessary so that it becomes a number and isn’t just a character?

A1: Yes, converting from ascii value to ordinal posiition of that letter within the alphabet


Q: what kind of an underlying structure is a lexicon?

A1: a fancy kind of letter tree


Q: we cannot see

A1: bummer!


Q: i think you might have to publish/display results once everyone has submitted

A1: Ok, thanks for the tip


Q: this is great fun!

A1: even more fun in person
 Someday!


Q: what would an error look like in the case of a collision?

A1: Typically you build in a resolution process that works out how to store both, you don’t want it to be an error


Q: how it is O(1) if we have to iterate through linked list?

A1: Great question!. The idea is to keep the lists very small, just a few items.


Q: is traversing the linked list to get to the right key negligible in terms of complexity? in my mind, as soon as we need to traverse, i think of O(n), not O(1)


A1: Great question!. The idea is to keep the lists very small, just a few items.


Q: Cool imbed of code!!

A1: Agreed, that is neat!


Q: It's like the riddle, if there are 23 people in a room, what are the odds that 2 of them share the same birthday? (It's about 50%)

A1: Yes, exactly right! Are you in CS109??


Q: But why?? Due to random number generation?

A1: Google “Birthday problem” or “birthday paradox” to see explanation of math https://en.wikipedia.org/wiki/Birthday_problem