Divide-and-conquer algorithms

Divide-and-conquer algorithms

Divide-and-conquer algorithms are made up of three steps: divide, conquer, and combine. In the divide stage, we divide the data into smaller, more manageable fragments. In the conquer stage, we dissecate each division by operating some operation on it. Finally,comes the combine stage where we reassemble the processed divisions. Merge sorts are a good example in this case.

Merge sorts are usually dealt with recursively. We operate as the music goes by dividing big problems into smaller problems making them easier to solve.

For instance we have a list of 8 numbers that we divide in half. The 4 are then divided into groups of 2 until they get isolated into a single number.

Once analysed, we can merge them by 2 into an array.

We then remerge the array into bigger array container of 4 numbers, that we will arrange in ascending order. Finally we merge the two into a single array sorting them into the right order. The array is now sorted.


                                                             


要查看或添加评论,请登录

Dorian.H Mekni的更多文章

  • Central Processing Unit

    Central Processing Unit

    Don’t expect a computer to run code unless you instruct him to do so. Inevitably, as most machines, they do what they…

  • How to write a program ?

    How to write a program ?

    Well, some just go and write some code..

  • Communication Skills

    Communication Skills

    Communication is an exchange of information between individuals through common symbols or behaviour. Good…

  • Randomized algorithms

    Randomized algorithms

    Randomised algorithms are built on statistical features played by random numbers. Quicksort is a good example to…

  • Few topics in software engineering ?

    Few topics in software engineering ?

    What are the few topics in software engineering ? To better understand how to develop well-crafted software, it is…

  • How to design algorithm ?

    How to design algorithm ?

    In a broad sense, many algorithms approach problems in the same way. Thus, it is often convenient to classify them…

  • Grafik Marketing->

    Grafik Marketing->

    An album collecting beautiful pictures incorporating advert lines usable for marketing purposes. Access authorised to…

  • Grafik Marketing

    Grafik Marketing

    An album collecting beautiful pictures incorporating advert lines usable for marketing purposes. Access authorised to…

社区洞察

其他会员也浏览了