When you are developing an algorithm to solve a problem, it is important to first understand the problem. A problem often has two parts. The first part is a specification of the “input”, and the second part is a specification of the “output”.
While this part may seem obvious, it is often not the case. For example, if the input is “an array of integers that is sorted,” then the next question is how it is sorted and whether there are duplicate values.
The same applies to the specification of the output. For example, if the output is “the index of an element that matches a given value,” then the question is what if there are duplicate values in the array? What if the value is not found in the array?
Fortunately, as homework assignments, it is the duty of the professor to clearly define the specifications of the input and output of algorithms. Nonetheless, if something is not clear, it is important to ask for clarifications.
Initially, don’t try to specify pseudocode or logic. Try to think of an instance of the problem that is solvable by hand, then solve it by hand (manually). As you work on the problem, try to keep a log of intermediate steps and results of intermediate steps.
The important part of this step is try to be as systematic as possible. Think about how you can instruct another person to solve the problem.