The process of reaching a better solution never popped out of the blue as it is a paradigm of thinking based on several steps ought to be applied.

In this article, Those steps will be proposed with an example simplifying wrapping your head around it.

1. List the facts

2. Explain and understand

3. Exercise and Apply

4. Organize differentiate and analyze

5. Evaluate, Criticize and recommend

6. Create and Implement

Clarify with context

Let’s put this hierarchy into context by taking an engine for example.

First, we list the various parts of the engine.

The next level is to be able to understand and explain the functionality of each part.

The next level up is to be able to follow a procedure to replace a part.

Analyzing is the ability to illustrate the relationship between the different parts of the engine.

Evaluating would be criticizing and evaluating the different parts of the bike and being able to spot points of improvement.

The highest level of the hierarchy is creating, which is the ability to come with a new better bike.

Usage within problem-solving

Problem

Given an array of size N (int32), find an element that repeats more than half its size. ie, EQUATION: Equation. Assume that on each given array, there is always such element.

Solution

The first level is to clarify the problem before even trying to understand the problem. that is Int32, Ceiling values, Space Complexity, an array of integers.

Next level up would be understanding the problem which is straightforward.

The third level is to try running some examples

for array 1, 1 the result is 1

for array 1,2,1 the result is 1

for array 1, 2, 1, 1 the result is 1 as 1 appears 3 times which holds EQUATION: Equation

for array 1,4,5,6,7,1,1,1,1,1 the result is 1 as 1 appears 6 times which holds EQUATION: Equation

The next level is to Organize differentiate and analyze which is the first step toward a solution.

We notice that in any given array, let X be the common number in the array. so a typical array can be represented using X as follows:

X, ? , X, …

where X is the common number and it appears more than any ?.

so if we grant each number a quota which is increased or decreased depends on whether the previous element in the array is equal or not. if a given element’s quota reaches zero, the consequent element will be selected as a nominee for common with a quota of 1. from now on, let’s refer to this selected element as a WINNER.

since we have a common number in any given array, this very common number will be a winner more than any other number due to the fact that it has the highest repetitions. Therefore, after scanning the array, it will be the winner.