Txoj kev faib thiab kev kov yeej: kom ib pab neeg tsis pom zoo thiab sib ntaus sib tua kom tsis txhob koom ua ke tawm tsam ib leeg Nws txoj kev ua tub rog yog kev sib faib thiab kov yeej.
Leej twg hais cov lus faib thiab kov yeej?
Nws tau siv los ntawm Roman tus kav Julius Caesar thiab Fabkis tus huab tais Napoleon (ua ke nrog cov maxim faib ut regnes).
Dab tsi yog lwm lo lus rau kev faib thiab kov yeej?
Lub ntsiab lus "sib faib thiab kov yeej"
Ua teeb meem ntawm tib neeg. Synonyms: tub sab . mugger . pickpocket.
Koj faib thiab kov yeej li cas?
Divide-and-conquer
- Faib qhov teeb meem mus rau ntau qhov teeb meem sub uas yog qhov me me ntawm tib qhov teeb meem.
- Txiav cov teeb meem sub los ntawm kev daws lawv rov ua dua. Yog tias lawv me me, daws cov teeb meem me me raws li cov teeb meem hauv paus.
- Kho kom daws tau qhov teeb meem sub rau hauv kev daws qhov teeb meem qub.
Dab tsi yuav yog qhov xwm txheej phem tshaj lub sijhawm nyuaj uas siv kev faib thiab kov yeej?
Merge Sort kuj yog ib qho kev txheeb cais. Lub algorithm faib cov array mus rau hauv ob halves, recursively sorted lawv, thiab thaum kawg muab ob sorted halves. Lub sij hawm complexity ntawm no algorithm yog O(nLogn), seb nws zoo tshaj plaws, nruab nrab rooj plaub los yog phem tshaj. … Nws yog kev faib thiab kov yeej algorithm uas ua haujlwm hauv O (nlogn) lub sijhawm.