Bottom–up and top–down are both strategies of information processing and ordering knowledge, used in a variety of fields including software. Top down and bottom up are two different ways of solving the same problems.
In the top-down approach, a algorithm is broken down into smaller sub problems. These sub problems are then further broken down into smaller fragments until they can no longer be fragmented. This process is called ‘modularization.’ However, during the modularization process, you must always maintain the integrity and originality of the algorithm.
Contrary to the top-down approach, bottom-up programming focuses on designing an algorithm by beginning at the very basic level and building up as it goes. In this approach, the smaller sub problems are solved individually and are then integrated together to form a complete algorithmic design.
Bottom Up vs Top Down
Above picture shows the difference in time complexity between building a heap (‘heapify’) from the bottom up and form top down. The number in each circle shows the maximum times of swapping needed to add the respective node into the heap. By summing up the numbers on two sides, it will be obvious that building from bottom up have fewer times than from top down.