This past week we went over permutation approaches to finding anagrams, Big O notation and
efficiency.
It was very interesting to learn of the signature method of finding
anagrams of a word.
(above are two pictures, on the left is a picture of the lucky charms cereal and on the right is a cartoon picture of a leprechaun and the word March)
Initially, I could only come up with the straightforward
method of making every possible “word” combination possible and comparing it to
a list of valid words. However, Dan went over the signature method, which is a
faster and more efficient approach. The
signature method is when the letters to a word is sorted alphabetically and
this is word is compared to another words alphabetically sorted list of
letters. The lists are called signatures. Similar to how everyone has their own
signature, each word has a different signature, unless it is an anagram of
another. When the two algorithms are analyzed, the signature approach is faster
with longer words. Although, after learning about it I found that I liked the
signature approach better.
Furthermore, this week we also learned Big O notation. When
Dan introduced big oh notation the first thing I thought of was cheerios.
Although it seems weird, I found that thinking about cheerios made the lessen
easier to understand (although I think this was due to how hungry I was that
day). Never the less I seemed to have grasped what Big O notation is comprised
of ( the worst case that the code will ever have run time wise).
(on the left is a picture of the Cheerios cereal box)
Although conceptually I understand Big O notation I think implementing it would be difficult. This is since I felt the same with recursion but similar to what barelypassing148 said,
“ most of the time … coding for me is, well
trial and error, until I either get it right or give up”
(on the right is a cartoon picture of a guy holding his head and the word "overload" is above him in big letters)
As such, I hope that
on Monday Dan goes over Big O notation a little bit more, so that I can
helpfully learn more about it before I become lost.
No comments:
Post a Comment