C S 314 Final: Spring_2018_final_GradingCrit_And_Solutions
Document Summary
Dynamic programming algorithms starts with the simple versions of the problem and work up towards the large version. (or words to that effect: no. Not every problem can be solved from simpler versions and not every problem has an ordered set of solutions. (or words to that effect) // special case when empty result, efficiency if (startindex == stopindex) : suggested solution public linkedlist314 getsublist(int startindex, int stopindex) { Node tempthis = first; int pos = 0; while (pos < startindex && tempthis!= null) { if (tempthis != null) { return result; // add first element result. first = new node<>(temp. data); // add elements until run off list or done while (tempthis != null && pos < stopindex) { tempresult. next = new node<>(tempthis. data); tempresult = tempresult. next; tempthis = tempthis. next; pos++; Special case, startindex == stopindex, o(1), 2 points. Move to startindex: stop if out of bounds, 2 points if inbounds, moves successfully to startindex, 3 points.