Difference: CS255Spring09Discussions (8 vs. 9)

Revision 92009-03-11 - ChenDing

Line: 1 to 1
 
META TOPICPARENT name="CS255Spring09"

CS255/455 Spring 2009 Discussion Board

Line: 15 to 15
  Our code gets rid of d=b+a, so then the if-statement is empty. We could get rid of it. This example is very simple, but with else-statements and nested statements, things get a little more messy. Additionally we are only dealing with gotos and labels which means that we cant necessarily assume simple if-else control flow. Because we only count operations, I'm not sure this would help us in our "score", but might make the program a little nicer.
Added:
>
>
A Of course it would be a nice feature of anyone's compiler to remove branch code and empty blocks. It helps the overall score since the conditional goto statement is no longer executed. The gain adds up if the branch is in a loop. Currently, unconditional gotos are not counted, but in the future they should be, so the benefit of your transformation is appropriately reflected in the instruction count.
 
Q: Not having access to a nodes children array can be annoying. If nothing else, and method that returns an iterator or children's length should be added in the next version.
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback