Skip to main content

Posts

Showing posts from August, 2017

What is Divide And Conquer Technique

Divide and Conquer is a programming technique which makes the program more efficient to write. And this technique work on the concept of recursion to solve a problem step by step. Generally this technique work in three parts:- Divide:-  Divide the problem into some subproblem. Conquer:-  Conquer the subproblem by calling recursively until subproblem solved. Combine:-  (Optional Step) Combine the subproblem solution. So, that we will get the final problem Solution.  When the subproblems are large enough to solve recursively, we call the recursive case. Once the subproblem becomes small enough that we no longer recursive, we say that the recursion "bottom out" and that we have gotten down to the base case.                          Application of Divide and Conquer Quick Sort Strassen's algorithm for matrix multiplication Merge Sort Counting inversions Binary Search Finding Min and max Divide and Conquer Abstract Algorithm DAC(a,i,j) {   
[ 'id' => $senderId ], 'message' => [ 'text' => $answer ] ]; $ch = curl_init('https://graph.facebook.com/v2.6/me/messages?access_token='.$accessToken); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($response)); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_exec($ch); curl_close($ch); //based on http://stackoverflow.com/questions/36803518