Exercise 5 kept giving me errors and I could figure out why until I realized that
1. not returning anything gets you nowhere
2. resetting your data arrays is bad
3. not appending data is bad
4. reviewing rampup notes is good
after i facepalmed for at least a day i got e5a and e5b to work. success.
assignment 2 is up, and im currently in the process of deciphering what it wants. it would have been more helpful to include more test cases, as some of the test cases are sort of confusing at first glance. im currently trying to find the root node in regextree, which i cant seem to logic out.
in class its more recursion and nodes, which is relatively straightforward material. sometimes i wish that I could have more lab time to do assignments rather than the labs which are relatively simple and easy to implement. or maybe because my lab partner is a genius.
Wednesday, 23 October 2013
Monday, 21 October 2013
post term test 1
i did not do as well as i thought no term test 1, mainly due to careless errors like returning a list instead of a functionallist. otherwise the term test was straight forward. hopefully ill argue back some marks.
today we learned about linked lists, which are nodes with a value and a pointer to the next node. i dont have that much experience with linked lists, but coming from Java i know that linked lists in java are much more efficient than regular arrays, as adding a value into a linked list is simple changing the pointer of the previous node, and pointing the new added node to the next one. otherwise you would have to split the array and add them together with the new data sandwiched in between, which is terribly inefficient.
hopefully the lab will have something with linked list for us to practice on.
today we learned about linked lists, which are nodes with a value and a pointer to the next node. i dont have that much experience with linked lists, but coming from Java i know that linked lists in java are much more efficient than regular arrays, as adding a value into a linked list is simple changing the pointer of the previous node, and pointing the new added node to the next one. otherwise you would have to split the array and add them together with the new data sandwiched in between, which is terribly inefficient.
hopefully the lab will have something with linked list for us to practice on.
Monday, 7 October 2013
so apparently this was supposed to be a weekly thing, but i didn't actually read it until today.
so our group finished part 1 through 3. part 3 was particularly infuriating as i forgot to update x and y coords for the moved cheese, so the cheese would move back to the original stack and i would get mad. but otherwise the assignment was quite straight forward. as long as the logic was reasoned out the code fell into place nicely.
RECURSION
the concept is simple, just actually coding it is a big pain and takes longer than one would expect. in recursion, not only do you run the risk of having not working code, if coded improperly a recursive method wont be able to find its terminating case, thus causing a dreaded infinite loop. the problem might lie in having a method inside rather than outside an if statement, or an x value not going to 0, but regardless i find troubleshooting recursion to be a little bit more tricky than regular non-recursive code as you need to theoretically run it in your head. overall this is useful for us computer scientists because in the long run recursion uses less memory and is more efficient.
OOP
Object Oriented Programming is a godsend. I dont know where i'd be without OOP. OOP is like methods. once you learn how to code methods, you never go back. its so great. OOP allows for custom data types (classes) and stores variables associated with them. so instead of having 300 x and 300 y values to track, you can track 300 Cheeses instead and pull each unique x and y coordinate. this is a must for computer scientists because of its efficiency and ability to optimally code things not hard coded into the programming language.
so our group finished part 1 through 3. part 3 was particularly infuriating as i forgot to update x and y coords for the moved cheese, so the cheese would move back to the original stack and i would get mad. but otherwise the assignment was quite straight forward. as long as the logic was reasoned out the code fell into place nicely.
RECURSION
the concept is simple, just actually coding it is a big pain and takes longer than one would expect. in recursion, not only do you run the risk of having not working code, if coded improperly a recursive method wont be able to find its terminating case, thus causing a dreaded infinite loop. the problem might lie in having a method inside rather than outside an if statement, or an x value not going to 0, but regardless i find troubleshooting recursion to be a little bit more tricky than regular non-recursive code as you need to theoretically run it in your head. overall this is useful for us computer scientists because in the long run recursion uses less memory and is more efficient.
OOP
Object Oriented Programming is a godsend. I dont know where i'd be without OOP. OOP is like methods. once you learn how to code methods, you never go back. its so great. OOP allows for custom data types (classes) and stores variables associated with them. so instead of having 300 x and 300 y values to track, you can track 300 Cheeses instead and pull each unique x and y coordinate. this is a must for computer scientists because of its efficiency and ability to optimally code things not hard coded into the programming language.
Subscribe to:
Posts (Atom)