Lecture 10 Notes

4 4 4 d5 3 2

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ¤ £ 4¡ "¡4     § ¢¢¨ ¨¥  ! £ 3¢ !  ¥ ¤ ¥  £  D¡ ¢¨ ¡ 5©0   ¢ !¢   4¡ £¤ ¥ v0 v1 v2 v2 v1 v0       usage: number-elements Sometimes you need to generalize the problem before you can solve it. 1.8 Auxiliary Procedures and Context Arguments There are two important observations to be made here: has an independent specification. It’s   4 D!¨¥  ¤¢ ¢¤¦§ ¡ 4 ¤¡ !©1 § ¤"£¦§ "  ¡ "¡4 not random! This gives us a slogan: No Mysterious Auxiliaries! When defining an auxiliary procedure, always specify what it does on all arguments, not just the initial values.   4¤ £¦§ "  5D" ¤©¨¥  ¤¢ ¢¤¦§ ¡ 4 ¤¡ !©1 § ¡ "¡4 The two arguments to ferent roles. play two dif- The first argument is the list we are working on. It gets smaller at every recursive call. The second argument is an abstraction of the context in which we are workalways works on a sublist of the ing. original list. The second argument re...
View Full Document

This document was uploaded on 03/17/2014 for the course CSG 111 at Northeastern.

Ask a homework question - tutors are online