Conditionals, Recursion, and Loops
摘要
This chapter reintroduces three core concepts in programming to readers: conditionals, recursion, and loops.We explain the Java syntax and intracacies surrounding if, else if, and else, as well as the illustrious switch/case statement. Repetition joins the discussion with recursion as a means of breaking down a problem into easier-to-solve smaller problems. We conclude with an introduction to loops via a translation pipeline from tail recursion, and consequently demonstrate that loops can be used as a substitute for any recursive algorithm, and may in fact be simpler for certain problems.