When writing a (computer science) research paper, I have to describe my method in term in pseudocode. Because of readability and reusability, I want to break my method into smaller pieces. However, I don't know how to present them in my paper. As far as I know, there are two approaches:
- Top-down: first, present a main pseudocode which calls/invokes other smaller ones which will be explained later.
- Bottom-up: present and explain all the smaller pieces first, then combine them together into a bigger one.
For example, in my paper, I'm presenting a method to solve to a problem, this method is describe by a funtion, named SOLVE_PROBLEM
, as follow:
SOLVE_PROBLEM(input) {
if CHECK(input) then:
FUNCTION_1(input)
else:
FUNCTION_2(input)
}
As you can see, SOLVE_PROBLEM
uses other functions (CHECK
, FUNCTION_1
and FUNCTION_2
) to find a solution. My question is to how to presents those functions in my paper. Should I present i) SOLVE_PROBLEM
first (as it is the solution to the problem, which is the main point of the paper), or ii) other methods fisrt (as they are the building blocks to a solution)?