What is a helper method?


#1

Question

What is a helper method?

Answer

A helper method is a term used to describe some method that is reused often by other methods or parts of a program. Helper methods are typically not too complex and help shorten code for frequently used minor tasks. Using helper methods can also help to reduce error in code by having the logic in one place.

In the heap implementation in this lesson, the helper methods are parent_idx(), left_child_idx(), and right_child_idx(), which are used in other more complex functions such as heapify_up().


Sal's Shipping Project Troubles