Drupal : Order of Hook Execution

Ever wondered what would be the order of execution of same hooks from different modules.

Say you have two modules active m1 and m2, each of which have the following functions
m1_node_presave($node) : Replaces Node's Title with "Title A" before saving
m2_node_presave($node) : Replaces Node's Title with "Title B" before saving

What would be the title of the node when saved?

Then you gotta check out hook_module_implements_alter

Below is the hook from some active module say 'mymodule', that makes m2 to implement its hooks last in order after all others modules..

function mymodule_module_implements_alter(&$module_list, $context){
$context === "node_insert"){
$temp = $module_list['m2'];
// Removing the mymodule key/value
// Adding the mymodule key value as the last member in the list
$module_list['m2'] = $temp;

Remember to declare the “module_list” variable as a reference variable with the “&”