> For the complete documentation index, see [llms.txt](https://www.csprinciples.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csprinciples.com/big-idea-3/3.9-developing-algorithms.md).

# 3.9 Developing Algorithms

## Enduring Understanding

The way statements are sequenced and combined in a program determines the computed result. Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.

## Learning Objective

Compare multiple algorithms to determine if they yield the same side effect or result. 

## Essential Knowledge

Algorithms can be written in different ways and still accomplish the same tasks.

Algorithms that appear similar can yield different side effects or results.

Some conditional statements can be written as equivalent Boolean expressions.

Some Boolean expressions can be written as equivalent conditional statements.

Different algorithms can be developed or used to solve the same problem.

## Learning Objective

For algorithms:

a. Create algorithms.

b. Combine and modify existing algorithms.

## Essential Knowledge

Algorithms can be created from an idea, by combining existing algorithms, or by modifying existing algorithms.

Knowledge of existing algorithms can help in constructing new ones. Some existing algorithms include:

* determining the maximum or minimum value of two or more numbers
* computing the sum or average of two or more numbers
* identifying if an integer is or is not evenly divisible by another integer
* determining a robot’s path through a maze

Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reducing testing, and simplifying the identification of errors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.csprinciples.com/big-idea-3/3.9-developing-algorithms.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
