Well, I just became the 1,203 person to solve 16 "problems" on Rosalind. Not much of an accomplishment. I see at least one person solved 32 in only 4 days. Each problem so far has only taken between 5 and 30 minutes. I guess I can be slower than I thought.
I finished the (zero relative) Week 1 lectures in "Coding the Matrix". This weeks lab looks to be interesting. By the end of it I will have defined a vector class with overloaded infix operators.
An infix operator is placed between the two expressions upon which it operates. For instance the plus sign(+) in "4+3" is an infix operator. While a vector can be written as a list, [1, 2, 3, 4] for instance, the class will be using two properties, D and f, for domain and function where given a vector x, x.D is the set of indices in the domain and f is a directory that map indices to their non-zero values. When an index in the domain isn't in the dictionary its value is zero.
In python a dictionary has this form {i:x, j:y, k:z} where the value before the colon(:) is the index and the value after the colon is the value at the index. Given a dictionary f={i:x, j:y, k:z}, f[i] would return the value x.
I've got to go to bed now.
No comments:
Post a Comment