Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Description

In this lesson, students will learn about recursion and recursive methods. A recursive method is a method that calls itself. Recursive methods contain at least one base case, which halts the recursion, and at least one recursive call. This lesson corresponds with AP Computer Science A topic 10.1.

Objective

Students will be able to:

  • Determine the result of executing recursive methods

Enduring Understandings

This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…

  • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.O)
Description

In this lesson, students will examine and apply recursive searching such as the binary search. The binary search algorithm starts at the middle of a sorted array or ArrayList and eliminates half of the array or ArrayList in each iteration until the desired value is found or all elements have been eliminated. This lesson corresponds with AP Computer Science A topic 10.2.

Objective

Students will be able to:

  • Apply recursive search algorithms to information in String, 1D array, or ArrayList objects
Description

In this lesson, students will use recursive methods to sort an array called Merge Sort. Merge sort is a recursive sorting algorithm that can be used to sort elements in an array or ArrayList. This lesson corresponds with AP Computer Science A topic 10.3.

Objective

Students will be able to:

  • Apply recursive algorithms to sort elements of an array or ArrayList objects