SlideShare a Scribd company logo
i




                                                                    MỤC LỤC

PHẦN 1. BÀI TOÁN LIỆT KÊ ......................................................................... 1

§1. NHẮC LẠI MỘT SỐ KIẾN THỨC ĐẠI SỐ TỔ HỢP ................................................................2
   1.1. CHỈNH HỢP LẶP ....................................................................................................................................... 2
   1.2. CHỈNH HỢP KHÔNG LẶP........................................................................................................................ 2
   1.3. HOÁN VỊ .................................................................................................................................................... 2
   1.4. TỔ HỢP....................................................................................................................................................... 3

§2. PHƯƠNG PHÁP SINH (GENERATION) ....................................................................................4
   2.1. SINH CÁC DÃY NHỊ PHÂN ĐỘ DÀI N................................................................................................... 5
   2.2. LIỆT KÊ CÁC TẬP CON K PHẦN TỬ ..................................................................................................... 6
   2.3. LIỆT KÊ CÁC HOÁN VỊ ........................................................................................................................... 8

§3. THUẬT TOÁN QUAY LUI ..........................................................................................................12
   3.1. LIỆT KÊ CÁC DÃY NHỊ PHÂN ĐỘ DÀI N ........................................................................................... 12
   3.2. LIỆT KÊ CÁC TẬP CON K PHẦN TỬ ................................................................................................... 13
   3.3. LIỆT KÊ CÁC CHỈNH HỢP KHÔNG LẶP CHẬP K ............................................................................. 15
   3.4. BÀI TOÁN PHÂN TÍCH SỐ .................................................................................................................... 17
   3.5. BÀI TOÁN XẾP HẬU .............................................................................................................................. 19

§4. KỸ THUẬT NHÁNH CẬN ...........................................................................................................24
   4.1. BÀI TOÁN TỐI ƯU.................................................................................................................................. 24
   4.2. SỰ BÙNG NỔ TỔ HỢP............................................................................................................................ 24
   4.3. MÔ HÌNH KỸ THUẬT NHÁNH CẬN.................................................................................................... 24
   4.4. BÀI TOÁN NGƯỜI DU LỊCH ................................................................................................................. 25
   4.5. DÃY ABC ................................................................................................................................................. 27


PHẦN 2. CẤU TRÚC DỮ LIỆU VÀ GIẢI THUẬT ..................................... 33

§1. CÁC BƯỚC CƠ BẢN KHI TIẾN HÀNH GIẢI CÁC BÀI TOÁN TIN HỌC .........................34
   1.1. XÁC ĐỊNH BÀI TOÁN............................................................................................................................ 34
   1.2. TÌM CẤU TRÚC DỮ LIỆU BIỂU DIỄN BÀI TOÁN ............................................................................. 34
   1.3. TÌM THUẬT TOÁN ................................................................................................................................. 35
   1.4. LẬP TRÌNH .............................................................................................................................................. 37
   1.5. KIỂM THỬ................................................................................................................................................ 37
   1.6. TỐI ƯU CHƯƠNG TRÌNH ...................................................................................................................... 38

§2. PHÂN TÍCH THỜI GIAN THỰC HIỆN GIẢI THUẬT ...........................................................40
   2.1. GIỚI THIỆU.............................................................................................................................................. 40
   2.2. CÁC KÝ PHÁP ĐỂ ĐÁNH GIÁ ĐỘ PHỨC TẠP TÍNH TOÁN............................................................. 40
   2.3. XÁC ĐỊNH ĐỘ PHỨC TẠP TÍNH TOÁN CỦA GIẢI THUẬT ............................................................ 42
   2.4. ĐỘ PHỨC TẠP TÍNH TOÁN VỚI TÌNH TRẠNG DỮ LIỆU VÀO....................................................... 45
   2.5. CHI PHÍ THỰC HIỆN THUẬT TOÁN.................................................................................................... 46
ii


§3. ĐỆ QUY VÀ GIẢI THUẬT ĐỆ QUY ......................................................................................... 50
   3.1. KHÁI NIỆM VỀ ĐỆ QUY ........................................................................................................................50
   3.2. GIẢI THUẬT ĐỆ QUY.............................................................................................................................50
   3.3. VÍ DỤ VỀ GIẢI THUẬT ĐỆ QUY ..........................................................................................................51
   3.4. HIỆU LỰC CỦA ĐỆ QUY .......................................................................................................................55

§4. CẤU TRÚC DỮ LIỆU BIỂU DIỄN DANH SÁCH.................................................................... 58
   4.1. KHÁI NIỆM DANH SÁCH ......................................................................................................................58
   4.2. BIỂU DIỄN DANH SÁCH TRONG MÁY TÍNH ....................................................................................58

§5. NGĂN XẾP VÀ HÀNG ĐỢI ........................................................................................................ 64
   5.1. NGĂN XẾP (STACK)...............................................................................................................................64
   5.2. HÀNG ĐỢI (QUEUE)...............................................................................................................................66

§6. CÂY (TREE).................................................................................................................................. 70
   6.1. ĐỊNH NGHĨA............................................................................................................................................70
   6.2. CÂY NHỊ PHÂN (BINARY TREE) .........................................................................................................71
   6.3. BIỂU DIỄN CÂY NHỊ PHÂN ..................................................................................................................73
   6.4. PHÉP DUYỆT CÂY NHỊ PHÂN ..............................................................................................................75
   6.5. CÂY K_PHÂN ..........................................................................................................................................76
   6.6. CÂY TỔNG QUÁT...................................................................................................................................77

§7. KÝ PHÁP TIỀN TỐ, TRUNG TỐ VÀ HẬU TỐ ....................................................................... 80
   7.1. BIỂU THỨC DƯỚI DẠNG CÂY NHỊ PHÂN .........................................................................................80
   7.2. CÁC KÝ PHÁP CHO CÙNG MỘT BIỂU THỨC....................................................................................80
   7.3. CÁCH TÍNH GIÁ TRỊ BIỂU THỨC ........................................................................................................81
   7.4. CHUYỂN TỪ DẠNG TRUNG TỐ SANG DẠNG HẬU TỐ...................................................................84
   7.5. XÂY DỰNG CÂY NHỊ PHÂN BIỂU DIỄN BIỂU THỨC......................................................................87

§8. SẮP XẾP (SORTING) .................................................................................................................. 89
   8.1. BÀI TOÁN SẮP XẾP................................................................................................................................89
   8.2. THUẬT TOÁN SẮP XẾP KIỂU CHỌN (SELECTIONSORT) ...............................................................91
   8.3. THUẬT TOÁN SẮP XẾP NỔI BỌT (BUBBLESORT)...........................................................................92
   8.4. THUẬT TOÁN SẮP XẾP KIỂU CHÈN (INSERTIONSORT) ................................................................92
   8.5. SẮP XẾP CHÈN VỚI ĐỘ DÀI BƯỚC GIẢM DẦN (SHELLSORT) .....................................................94
   8.6. THUẬT TOÁN SẮP XẾP KIỂU PHÂN ĐOẠN (QUICKSORT) ............................................................95
   8.7. THUẬT TOÁN SẮP XẾP KIỂU VUN ĐỐNG (HEAPSORT) ..............................................................101
   8.8. SẮP XẾP BẰNG PHÉP ĐẾM PHÂN PHỐI (DISTRIBUTION COUNTING)......................................104
   8.9. TÍNH ỔN ĐỊNH CỦA THUẬT TOÁN SẮP XẾP (STABILITY) .........................................................105
   8.10. THUẬT TOÁN SẮP XẾP BẰNG CƠ SỐ (RADIX SORT) .................................................................106
   8.11. THUẬT TOÁN SẮP XẾP TRỘN (MERGESORT)..............................................................................111
   8.12. CÀI ĐẶT ...............................................................................................................................................114
   8.13. ĐÁNH GIÁ, NHẬN XÉT......................................................................................................................122

§9. TÌM KIẾM (SEARCHING) ....................................................................................................... 126
   9.1. BÀI TOÁN TÌM KIẾM ...........................................................................................................................126
   9.2. TÌM KIẾM TUẦN TỰ (SEQUENTIAL SEARCH) ...............................................................................126
   9.3. TÌM KIẾM NHỊ PHÂN (BINARY SEARCH)........................................................................................126
   9.4. CÂY NHỊ PHÂN TÌM KIẾM (BINARY SEARCH TREE - BST).........................................................127
iii


   9.5. PHÉP BĂM (HASH)............................................................................................................................... 132
   9.6. KHOÁ SỐ VỚI BÀI TOÁN TÌM KIẾM ................................................................................................ 133
   9.7. CÂY TÌM KIẾM SỐ HỌC (DIGITAL SEARCH TREE - DST)............................................................ 133
   9.8. CÂY TÌM KIẾM CƠ SỐ (RADIX SEARCH TREE - RST) .................................................................. 136
   9.9. NHỮNG NHẬN XÉT CUỐI CÙNG ...................................................................................................... 140


PHẦN 3. QUY HOẠCH ĐỘNG .................................................................... 143

§1. CÔNG THỨC TRUY HỒI ..........................................................................................................144
   1.1. VÍ DỤ ...................................................................................................................................................... 144
   1.2. CẢI TIẾN THỨ NHẤT........................................................................................................................... 145
   1.3. CẢI TIẾN THỨ HAI............................................................................................................................... 147
   1.4. CÀI ĐẶT ĐỆ QUY ................................................................................................................................. 147

§2. PHƯƠNG PHÁP QUY HOẠCH ĐỘNG ...................................................................................149
   2.1. BÀI TOÁN QUY HOẠCH ..................................................................................................................... 149
   2.2. PHƯƠNG PHÁP QUY HOẠCH ĐỘNG ................................................................................................ 149

§3. MỘT SỐ BÀI TOÁN QUY HOẠCH ĐỘNG ............................................................................153
   3.1. DÃY CON ĐƠN ĐIỆU TĂNG DÀI NHẤT ........................................................................................... 153
   3.2. BÀI TOÁN CÁI TÚI............................................................................................................................... 158
   3.3. BIẾN ĐỔI XÂU ...................................................................................................................................... 160
   3.4. DÃY CON CÓ TỔNG CHIA HẾT CHO K............................................................................................ 164
   3.5. PHÉP NHÂN TỔ HỢP DÃY MA TRẬN............................................................................................... 169
   3.6. BÀI TẬP LUYỆN TẬP........................................................................................................................... 172


PHẦN 4. CÁC THUẬT TOÁN TRÊN ĐỒ THỊ .......................................... 177

§1. CÁC KHÁI NIỆM CƠ BẢN .......................................................................................................178
   1.1. ĐỊNH NGHĨA ĐỒ THỊ (GRAPH) .......................................................................................................... 178
   1.2. CÁC KHÁI NIỆM................................................................................................................................... 179

§2. BIỂU DIỄN ĐỒ THỊ TRÊN MÁY TÍNH ..................................................................................181
   2.1. MA TRẬN KỀ (ADJACENCY MATRIX)............................................................................................. 181
   2.2. DANH SÁCH CẠNH (EDGE LIST) ...................................................................................................... 182
   2.3. DANH SÁCH KỀ (ADJACENCY LIST) ............................................................................................... 183
   2.4. NHẬN XÉT............................................................................................................................................. 184

§3. CÁC THUẬT TOÁN TÌM KIẾM TRÊN ĐỒ THỊ ...................................................................186
   3.1. BÀI TOÁN .............................................................................................................................................. 186
   3.2. THUẬT TOÁN TÌM KIẾM THEO CHIỀU SÂU (DEPTH FIRST SEARCH)...................................... 187
   3.3. THUẬT TOÁN TÌM KIẾM THEO CHIỀU RỘNG (BREADTH FIRST SEARCH) ............................ 189
   3.4. ĐỘ PHỨC TẠP TÍNH TOÁN CỦA BFS VÀ DFS ................................................................................ 192

§4. TÍNH LIÊN THÔNG CỦA ĐỒ THỊ ..........................................................................................193
   4.1. ĐỊNH NGHĨA ......................................................................................................................................... 193
   4.2. TÍNH LIÊN THÔNG TRONG ĐỒ THỊ VÔ HƯỚNG ........................................................................... 194
iv


   4.3. ĐỒ THỊ ĐẦY ĐỦ VÀ THUẬT TOÁN WARSHALL ...........................................................................194
   4.4. CÁC THÀNH PHẦN LIÊN THÔNG MẠNH ........................................................................................197

§5. VÀI ỨNG DỤNG CỦA DFS và BFS ......................................................................................... 207
   5.1. XÂY DỰNG CÂY KHUNG CỦA ĐỒ THỊ............................................................................................207
   5.2. TẬP CÁC CHU TRÌNH CƠ SỞ CỦA ĐỒ THỊ......................................................................................210
   5.3. BÀI TOÁN ĐỊNH CHIỀU ĐỒ THỊ ........................................................................................................210
   5.4. LIỆT KÊ CÁC KHỚP VÀ CẦU CỦA ĐỒ THỊ......................................................................................214

§6. CHU TRÌNH EULER, ĐƯỜNG ĐI EULER, ĐỒ THỊ EULER ............................................. 217
   6.1. BÀI TOÁN 7 CÁI CẦU ..........................................................................................................................217
   6.2. ĐỊNH NGHĨA..........................................................................................................................................217
   6.3. ĐỊNH LÝ .................................................................................................................................................217
   6.4. THUẬT TOÁN FLEURY TÌM CHU TRÌNH EULER...........................................................................218
   6.5. CÀI ĐẶT .................................................................................................................................................219
   6.6. THUẬT TOÁN TỐT HƠN......................................................................................................................221

§7. CHU TRÌNH HAMILTON, ĐƯỜNG ĐI HAMILTON, ĐỒ THỊ HAMILTON .................. 224
   7.1. ĐỊNH NGHĨA..........................................................................................................................................224
   7.2. ĐỊNH LÝ .................................................................................................................................................224
   7.3. CÀI ĐẶT .................................................................................................................................................225

§8. BÀI TOÁN ĐƯỜNG ĐI NGẮN NHẤT..................................................................................... 229
   8.1. ĐỒ THỊ CÓ TRỌNG SỐ.........................................................................................................................229
   8.2. BÀI TOÁN ĐƯỜNG ĐI NGẮN NHẤT .................................................................................................229
   8.3. TRƯỜNG HỢP ĐỒ THỊ KHÔNG CÓ CHU TRÌNH ÂM - THUẬT TOÁN FORD BELLMAN .........231
   8.4. TRƯỜNG HỢP TRỌNG SỐ TRÊN CÁC CUNG KHÔNG ÂM - THUẬT TOÁN DIJKSTRA ...........233
   8.5. THUẬT TOÁN DIJKSTRA VÀ CẤU TRÚC HEAP .............................................................................236
   8.6. TRƯỜNG HỢP ĐỒ THỊ KHÔNG CÓ CHU TRÌNH - SẮP XẾP TÔ PÔ..............................................239
   8.7. ĐƯỜNG ĐI NGẮN NHẤT GIỮA MỌI CẶP ĐỈNH - THUẬT TOÁN FLOYD...................................242
   8.8. NHẬN XÉT .............................................................................................................................................244

§9. BÀI TOÁN CÂY KHUNG NHỎ NHẤT ................................................................................... 248
   9.1. BÀI TOÁN CÂY KHUNG NHỎ NHẤT ................................................................................................248
   9.2. THUẬT TOÁN KRUSKAL (JOSEPH KRUSKAL - 1956) ...................................................................248
   9.3. THUẬT TOÁN PRIM (ROBERT PRIM - 1957)....................................................................................253

§10. BÀI TOÁN LUỒNG CỰC ĐẠI TRÊN MẠNG...................................................................... 257
   10.1. CÁC KHÁI NIỆM .................................................................................................................................257
   10.2. MẠNG THẶNG DƯ VÀ ĐƯỜNG TĂNG LUỒNG ............................................................................260
   10.3. THUẬT TOÁN FORD-FULKERSON (L.R.FORD & D.R.FULKERSON - 1962) .............................262
   10.4. THUẬT TOÁN PREFLOW-PUSH (GOLDBERG - 1986) ..................................................................266
   10.5. MỘT SỐ MỞ RỘNG.............................................................................................................................272

§11. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI TRÊN ĐỒ THỊ HAI PHÍA .................................... 280
   11.1. ĐỒ THỊ HAI PHÍA (BIPARTITE GRAPH) .........................................................................................280
   11.2. BÀI TOÁN GHÉP ĐÔI KHÔNG TRỌNG VÀ CÁC KHÁI NIỆM .....................................................280
   11.3. THUẬT TOÁN ĐƯỜNG MỞ ...............................................................................................................281
   11.4. CÀI ĐẶT ...............................................................................................................................................282
v


§12. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI VỚI TRỌNG SỐ CỰC TIỂU TRÊN ĐỒ THỊ HAI
PHÍA - THUẬT TOÁN HUNGARI .................................................................................................288
   12.1. BÀI TOÁN PHÂN CÔNG .................................................................................................................... 288
   12.2. PHÂN TÍCH .......................................................................................................................................... 288
   12.3. THUẬT TOÁN...................................................................................................................................... 289
   12.4. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI VỚI TRỌNG SỐ CỰC ĐẠI TRÊN ĐỒ THỊ HAI PHÍA....... 298
   12.5. NÂNG CẤP........................................................................................................................................... 299

§13. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI TRÊN ĐỒ THỊ.........................................................304
   13.1. CÁC KHÁI NIỆM................................................................................................................................. 304
   13.2. THUẬT TOÁN EDMONDS (1965) ..................................................................................................... 305
   13.3. THUẬT TOÁN LAWLER (1973)......................................................................................................... 307
   13.4. CÀI ĐẶT ............................................................................................................................................... 309
   13.5. ĐỘ PHỨC TẠP TÍNH TOÁN............................................................................................................... 313


TÀI LIỆU ĐỌC THÊM.................................................................................. 315

More Related Content

What's hot

800 recetas thermomix
800 recetas thermomix800 recetas thermomix
800 recetas thermomix
Domingo Dias Festivos
 
Aurobindo's yaugik sadhana
Aurobindo's yaugik sadhanaAurobindo's yaugik sadhana
Aurobindo's yaugik sadhana
Unni Nair
 
الدراسات الاجتماعية
الدراسات الاجتماعيةالدراسات الاجتماعية
الدراسات الاجتماعية
Teaching Skills
 
Jinn in Islam
Jinn in IslamJinn in Islam
Jinn in Islam
Shane Elahi
 
Yoga the science of breath - 71pgs
Yoga   the science of breath - 71pgsYoga   the science of breath - 71pgs
Yoga the science of breath - 71pgs
Marcus Vannini
 
In The Shade Of The Qur’an Volume 6 surah_7
In The Shade Of The Qur’an Volume 6 surah_7In The Shade Of The Qur’an Volume 6 surah_7
In The Shade Of The Qur’an Volume 6 surah_7
Caller To Islam / الداعية الإسلامي
 
(Pdf) Buddhist Ebook Buddhism Manual Of Zen Buddhism
(Pdf)   Buddhist Ebook   Buddhism   Manual Of Zen Buddhism(Pdf)   Buddhist Ebook   Buddhism   Manual Of Zen Buddhism
(Pdf) Buddhist Ebook Buddhism Manual Of Zen Buddhism
Kukuasu
 
AK: Juneau Stormwater Guidance Manual
AK: Juneau Stormwater Guidance ManualAK: Juneau Stormwater Guidance Manual
AK: Juneau Stormwater Guidance Manual
Sotirakou964
 
Sanjeev Kapoor S Indian Recipes
Sanjeev  Kapoor S  Indian  RecipesSanjeev  Kapoor S  Indian  Recipes
Sanjeev Kapoor S Indian Recipes
guestae43cb
 
Engineering composites
Engineering compositesEngineering composites
Engineering composites
Muthamizhan Tamil
 
Indian Food Recipes-sanjeev.kapoor
Indian Food Recipes-sanjeev.kapoorIndian Food Recipes-sanjeev.kapoor
Indian Food Recipes-sanjeev.kapoor
Praveen Verma
 
final print
final printfinal print
final print
Vishal Shah
 
دفتر يومي معدل
دفتر يومي معدلدفتر يومي معدل
دفتر يومي معدل
guest696cefa
 
In The Shade Of The Qur’an Volume 12 surahs_21-25
In The Shade Of The Qur’an Volume 12 surahs_21-25In The Shade Of The Qur’an Volume 12 surahs_21-25
In The Shade Of The Qur’an Volume 12 surahs_21-25
Caller To Islam / الداعية الإسلامي
 
In The Shade Of The Qur’an Volume 5 surah_6
In The Shade Of The Qur’an Volume 5 surah_6In The Shade Of The Qur’an Volume 5 surah_6
In The Shade Of The Qur’an Volume 5 surah_6
Caller To Islam / الداعية الإسلامي
 
Instruction manual | Celestron CPC Telescopes | Optics Trade
Instruction manual | Celestron CPC Telescopes | Optics TradeInstruction manual | Celestron CPC Telescopes | Optics Trade
Instruction manual | Celestron CPC Telescopes | Optics Trade
Optics-Trade
 
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
Muhammad Umair Zulfiqar
 
An Inquiry Into Pricing Of Hotels
An Inquiry Into Pricing Of HotelsAn Inquiry Into Pricing Of Hotels
An Inquiry Into Pricing Of Hotels
Aliasger_Lehry
 
RVulic Project Samples
RVulic Project SamplesRVulic Project Samples
RVulic Project Samples
Rebecca Vulic
 

What's hot (19)

800 recetas thermomix
800 recetas thermomix800 recetas thermomix
800 recetas thermomix
 
Aurobindo's yaugik sadhana
Aurobindo's yaugik sadhanaAurobindo's yaugik sadhana
Aurobindo's yaugik sadhana
 
الدراسات الاجتماعية
الدراسات الاجتماعيةالدراسات الاجتماعية
الدراسات الاجتماعية
 
Jinn in Islam
Jinn in IslamJinn in Islam
Jinn in Islam
 
Yoga the science of breath - 71pgs
Yoga   the science of breath - 71pgsYoga   the science of breath - 71pgs
Yoga the science of breath - 71pgs
 
In The Shade Of The Qur’an Volume 6 surah_7
In The Shade Of The Qur’an Volume 6 surah_7In The Shade Of The Qur’an Volume 6 surah_7
In The Shade Of The Qur’an Volume 6 surah_7
 
(Pdf) Buddhist Ebook Buddhism Manual Of Zen Buddhism
(Pdf)   Buddhist Ebook   Buddhism   Manual Of Zen Buddhism(Pdf)   Buddhist Ebook   Buddhism   Manual Of Zen Buddhism
(Pdf) Buddhist Ebook Buddhism Manual Of Zen Buddhism
 
AK: Juneau Stormwater Guidance Manual
AK: Juneau Stormwater Guidance ManualAK: Juneau Stormwater Guidance Manual
AK: Juneau Stormwater Guidance Manual
 
Sanjeev Kapoor S Indian Recipes
Sanjeev  Kapoor S  Indian  RecipesSanjeev  Kapoor S  Indian  Recipes
Sanjeev Kapoor S Indian Recipes
 
Engineering composites
Engineering compositesEngineering composites
Engineering composites
 
Indian Food Recipes-sanjeev.kapoor
Indian Food Recipes-sanjeev.kapoorIndian Food Recipes-sanjeev.kapoor
Indian Food Recipes-sanjeev.kapoor
 
final print
final printfinal print
final print
 
دفتر يومي معدل
دفتر يومي معدلدفتر يومي معدل
دفتر يومي معدل
 
In The Shade Of The Qur’an Volume 12 surahs_21-25
In The Shade Of The Qur’an Volume 12 surahs_21-25In The Shade Of The Qur’an Volume 12 surahs_21-25
In The Shade Of The Qur’an Volume 12 surahs_21-25
 
In The Shade Of The Qur’an Volume 5 surah_6
In The Shade Of The Qur’an Volume 5 surah_6In The Shade Of The Qur’an Volume 5 surah_6
In The Shade Of The Qur’an Volume 5 surah_6
 
Instruction manual | Celestron CPC Telescopes | Optics Trade
Instruction manual | Celestron CPC Telescopes | Optics TradeInstruction manual | Celestron CPC Telescopes | Optics Trade
Instruction manual | Celestron CPC Telescopes | Optics Trade
 
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
Sapphire Textile Mills Limited - Activities Report - Muhammad Umair Zulfiqar ...
 
An Inquiry Into Pricing Of Hotels
An Inquiry Into Pricing Of HotelsAn Inquiry Into Pricing Of Hotels
An Inquiry Into Pricing Of Hotels
 
RVulic Project Samples
RVulic Project SamplesRVulic Project Samples
RVulic Project Samples
 

Similar to Toc

98432535 women-empowerment-project
98432535 women-empowerment-project98432535 women-empowerment-project
98432535 women-empowerment-project
Nitesh Kumar
 
Daftar iai pkmk kelompok pancasila
Daftar iai pkmk kelompok pancasilaDaftar iai pkmk kelompok pancasila
Daftar iai pkmk kelompok pancasila
nickarista
 
Mi manual fisica 2
Mi manual fisica 2Mi manual fisica 2
Mi manual fisica 2
americo alvarez
 
Master cc&r's 2002-482548-082902
Master cc&r's 2002-482548-082902Master cc&r's 2002-482548-082902
Master cc&r's 2002-482548-082902
Steve Alexander
 
CRNM - Entertainment Study
CRNM - Entertainment StudyCRNM - Entertainment Study
Business Plan MBA OUM
Business Plan MBA OUMBusiness Plan MBA OUM
Business Plan MBA OUM
Shah Sheikh
 
Squareform
SquareformSquareform
Squareform
ckgohj ck
 
Giao trinhgiaithuat03
Giao trinhgiaithuat03Giao trinhgiaithuat03
Giao trinhgiaithuat03
Phi Phi
 
Layout for the project
Layout for the projectLayout for the project
Layout for the project
Krupol Phato
 
Kioti Daedong DK50 Tractor Service Repair Manual.pdf
Kioti Daedong DK50 Tractor Service Repair Manual.pdfKioti Daedong DK50 Tractor Service Repair Manual.pdf
Kioti Daedong DK50 Tractor Service Repair Manual.pdf
km7seyduh7dw
 
Kioti Daedong DK45 Tractor Service Repair Manual.pdf
Kioti Daedong DK45 Tractor Service Repair Manual.pdfKioti Daedong DK45 Tractor Service Repair Manual.pdf
Kioti Daedong DK45 Tractor Service Repair Manual.pdf
km7seyduh7dw
 
Kioti daedong dk45 tractor service repair manual
Kioti daedong dk45 tractor service repair manualKioti daedong dk45 tractor service repair manual
Kioti daedong dk45 tractor service repair manual
fjsekdmmme
 
Kioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manualKioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manual
fjseedcxkmdmme
 
Kioti Daedong DK45 Tractor Service Repair Manual
Kioti Daedong DK45 Tractor Service Repair ManualKioti Daedong DK45 Tractor Service Repair Manual
Kioti Daedong DK45 Tractor Service Repair Manual
hjsnekmde
 
Kioti Daedong DK50 Tractor Service Repair Manual
Kioti Daedong DK50 Tractor Service Repair ManualKioti Daedong DK50 Tractor Service Repair Manual
Kioti Daedong DK50 Tractor Service Repair Manual
kjksemjdmkdm
 
Kioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manualKioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manual
fjskedmmem
 
Derivatives basic module
Derivatives basic moduleDerivatives basic module
Derivatives basic module
pranjalbajaj30
 
Edbm workbook
Edbm workbookEdbm workbook
Edbm workbook
Dinesh Geddada
 
Common entrance
Common entranceCommon entrance
Common entrance
Ayoor Daves - PMP, M_o_R
 
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
Fayina19z
 

Similar to Toc (20)

98432535 women-empowerment-project
98432535 women-empowerment-project98432535 women-empowerment-project
98432535 women-empowerment-project
 
Daftar iai pkmk kelompok pancasila
Daftar iai pkmk kelompok pancasilaDaftar iai pkmk kelompok pancasila
Daftar iai pkmk kelompok pancasila
 
Mi manual fisica 2
Mi manual fisica 2Mi manual fisica 2
Mi manual fisica 2
 
Master cc&r's 2002-482548-082902
Master cc&r's 2002-482548-082902Master cc&r's 2002-482548-082902
Master cc&r's 2002-482548-082902
 
CRNM - Entertainment Study
CRNM - Entertainment StudyCRNM - Entertainment Study
CRNM - Entertainment Study
 
Business Plan MBA OUM
Business Plan MBA OUMBusiness Plan MBA OUM
Business Plan MBA OUM
 
Squareform
SquareformSquareform
Squareform
 
Giao trinhgiaithuat03
Giao trinhgiaithuat03Giao trinhgiaithuat03
Giao trinhgiaithuat03
 
Layout for the project
Layout for the projectLayout for the project
Layout for the project
 
Kioti Daedong DK50 Tractor Service Repair Manual.pdf
Kioti Daedong DK50 Tractor Service Repair Manual.pdfKioti Daedong DK50 Tractor Service Repair Manual.pdf
Kioti Daedong DK50 Tractor Service Repair Manual.pdf
 
Kioti Daedong DK45 Tractor Service Repair Manual.pdf
Kioti Daedong DK45 Tractor Service Repair Manual.pdfKioti Daedong DK45 Tractor Service Repair Manual.pdf
Kioti Daedong DK45 Tractor Service Repair Manual.pdf
 
Kioti daedong dk45 tractor service repair manual
Kioti daedong dk45 tractor service repair manualKioti daedong dk45 tractor service repair manual
Kioti daedong dk45 tractor service repair manual
 
Kioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manualKioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manual
 
Kioti Daedong DK45 Tractor Service Repair Manual
Kioti Daedong DK45 Tractor Service Repair ManualKioti Daedong DK45 Tractor Service Repair Manual
Kioti Daedong DK45 Tractor Service Repair Manual
 
Kioti Daedong DK50 Tractor Service Repair Manual
Kioti Daedong DK50 Tractor Service Repair ManualKioti Daedong DK50 Tractor Service Repair Manual
Kioti Daedong DK50 Tractor Service Repair Manual
 
Kioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manualKioti daedong dk50 tractor service repair manual
Kioti daedong dk50 tractor service repair manual
 
Derivatives basic module
Derivatives basic moduleDerivatives basic module
Derivatives basic module
 
Edbm workbook
Edbm workbookEdbm workbook
Edbm workbook
 
Common entrance
Common entranceCommon entrance
Common entrance
 
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
The Lost Secrets Of The Garden: The Companion Planting Guide For Vegetable Ga...
 

Recently uploaded

Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 

Recently uploaded (20)

Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 

Toc

  • 1. i MỤC LỤC PHẦN 1. BÀI TOÁN LIỆT KÊ ......................................................................... 1 §1. NHẮC LẠI MỘT SỐ KIẾN THỨC ĐẠI SỐ TỔ HỢP ................................................................2 1.1. CHỈNH HỢP LẶP ....................................................................................................................................... 2 1.2. CHỈNH HỢP KHÔNG LẶP........................................................................................................................ 2 1.3. HOÁN VỊ .................................................................................................................................................... 2 1.4. TỔ HỢP....................................................................................................................................................... 3 §2. PHƯƠNG PHÁP SINH (GENERATION) ....................................................................................4 2.1. SINH CÁC DÃY NHỊ PHÂN ĐỘ DÀI N................................................................................................... 5 2.2. LIỆT KÊ CÁC TẬP CON K PHẦN TỬ ..................................................................................................... 6 2.3. LIỆT KÊ CÁC HOÁN VỊ ........................................................................................................................... 8 §3. THUẬT TOÁN QUAY LUI ..........................................................................................................12 3.1. LIỆT KÊ CÁC DÃY NHỊ PHÂN ĐỘ DÀI N ........................................................................................... 12 3.2. LIỆT KÊ CÁC TẬP CON K PHẦN TỬ ................................................................................................... 13 3.3. LIỆT KÊ CÁC CHỈNH HỢP KHÔNG LẶP CHẬP K ............................................................................. 15 3.4. BÀI TOÁN PHÂN TÍCH SỐ .................................................................................................................... 17 3.5. BÀI TOÁN XẾP HẬU .............................................................................................................................. 19 §4. KỸ THUẬT NHÁNH CẬN ...........................................................................................................24 4.1. BÀI TOÁN TỐI ƯU.................................................................................................................................. 24 4.2. SỰ BÙNG NỔ TỔ HỢP............................................................................................................................ 24 4.3. MÔ HÌNH KỸ THUẬT NHÁNH CẬN.................................................................................................... 24 4.4. BÀI TOÁN NGƯỜI DU LỊCH ................................................................................................................. 25 4.5. DÃY ABC ................................................................................................................................................. 27 PHẦN 2. CẤU TRÚC DỮ LIỆU VÀ GIẢI THUẬT ..................................... 33 §1. CÁC BƯỚC CƠ BẢN KHI TIẾN HÀNH GIẢI CÁC BÀI TOÁN TIN HỌC .........................34 1.1. XÁC ĐỊNH BÀI TOÁN............................................................................................................................ 34 1.2. TÌM CẤU TRÚC DỮ LIỆU BIỂU DIỄN BÀI TOÁN ............................................................................. 34 1.3. TÌM THUẬT TOÁN ................................................................................................................................. 35 1.4. LẬP TRÌNH .............................................................................................................................................. 37 1.5. KIỂM THỬ................................................................................................................................................ 37 1.6. TỐI ƯU CHƯƠNG TRÌNH ...................................................................................................................... 38 §2. PHÂN TÍCH THỜI GIAN THỰC HIỆN GIẢI THUẬT ...........................................................40 2.1. GIỚI THIỆU.............................................................................................................................................. 40 2.2. CÁC KÝ PHÁP ĐỂ ĐÁNH GIÁ ĐỘ PHỨC TẠP TÍNH TOÁN............................................................. 40 2.3. XÁC ĐỊNH ĐỘ PHỨC TẠP TÍNH TOÁN CỦA GIẢI THUẬT ............................................................ 42 2.4. ĐỘ PHỨC TẠP TÍNH TOÁN VỚI TÌNH TRẠNG DỮ LIỆU VÀO....................................................... 45 2.5. CHI PHÍ THỰC HIỆN THUẬT TOÁN.................................................................................................... 46
  • 2. ii §3. ĐỆ QUY VÀ GIẢI THUẬT ĐỆ QUY ......................................................................................... 50 3.1. KHÁI NIỆM VỀ ĐỆ QUY ........................................................................................................................50 3.2. GIẢI THUẬT ĐỆ QUY.............................................................................................................................50 3.3. VÍ DỤ VỀ GIẢI THUẬT ĐỆ QUY ..........................................................................................................51 3.4. HIỆU LỰC CỦA ĐỆ QUY .......................................................................................................................55 §4. CẤU TRÚC DỮ LIỆU BIỂU DIỄN DANH SÁCH.................................................................... 58 4.1. KHÁI NIỆM DANH SÁCH ......................................................................................................................58 4.2. BIỂU DIỄN DANH SÁCH TRONG MÁY TÍNH ....................................................................................58 §5. NGĂN XẾP VÀ HÀNG ĐỢI ........................................................................................................ 64 5.1. NGĂN XẾP (STACK)...............................................................................................................................64 5.2. HÀNG ĐỢI (QUEUE)...............................................................................................................................66 §6. CÂY (TREE).................................................................................................................................. 70 6.1. ĐỊNH NGHĨA............................................................................................................................................70 6.2. CÂY NHỊ PHÂN (BINARY TREE) .........................................................................................................71 6.3. BIỂU DIỄN CÂY NHỊ PHÂN ..................................................................................................................73 6.4. PHÉP DUYỆT CÂY NHỊ PHÂN ..............................................................................................................75 6.5. CÂY K_PHÂN ..........................................................................................................................................76 6.6. CÂY TỔNG QUÁT...................................................................................................................................77 §7. KÝ PHÁP TIỀN TỐ, TRUNG TỐ VÀ HẬU TỐ ....................................................................... 80 7.1. BIỂU THỨC DƯỚI DẠNG CÂY NHỊ PHÂN .........................................................................................80 7.2. CÁC KÝ PHÁP CHO CÙNG MỘT BIỂU THỨC....................................................................................80 7.3. CÁCH TÍNH GIÁ TRỊ BIỂU THỨC ........................................................................................................81 7.4. CHUYỂN TỪ DẠNG TRUNG TỐ SANG DẠNG HẬU TỐ...................................................................84 7.5. XÂY DỰNG CÂY NHỊ PHÂN BIỂU DIỄN BIỂU THỨC......................................................................87 §8. SẮP XẾP (SORTING) .................................................................................................................. 89 8.1. BÀI TOÁN SẮP XẾP................................................................................................................................89 8.2. THUẬT TOÁN SẮP XẾP KIỂU CHỌN (SELECTIONSORT) ...............................................................91 8.3. THUẬT TOÁN SẮP XẾP NỔI BỌT (BUBBLESORT)...........................................................................92 8.4. THUẬT TOÁN SẮP XẾP KIỂU CHÈN (INSERTIONSORT) ................................................................92 8.5. SẮP XẾP CHÈN VỚI ĐỘ DÀI BƯỚC GIẢM DẦN (SHELLSORT) .....................................................94 8.6. THUẬT TOÁN SẮP XẾP KIỂU PHÂN ĐOẠN (QUICKSORT) ............................................................95 8.7. THUẬT TOÁN SẮP XẾP KIỂU VUN ĐỐNG (HEAPSORT) ..............................................................101 8.8. SẮP XẾP BẰNG PHÉP ĐẾM PHÂN PHỐI (DISTRIBUTION COUNTING)......................................104 8.9. TÍNH ỔN ĐỊNH CỦA THUẬT TOÁN SẮP XẾP (STABILITY) .........................................................105 8.10. THUẬT TOÁN SẮP XẾP BẰNG CƠ SỐ (RADIX SORT) .................................................................106 8.11. THUẬT TOÁN SẮP XẾP TRỘN (MERGESORT)..............................................................................111 8.12. CÀI ĐẶT ...............................................................................................................................................114 8.13. ĐÁNH GIÁ, NHẬN XÉT......................................................................................................................122 §9. TÌM KIẾM (SEARCHING) ....................................................................................................... 126 9.1. BÀI TOÁN TÌM KIẾM ...........................................................................................................................126 9.2. TÌM KIẾM TUẦN TỰ (SEQUENTIAL SEARCH) ...............................................................................126 9.3. TÌM KIẾM NHỊ PHÂN (BINARY SEARCH)........................................................................................126 9.4. CÂY NHỊ PHÂN TÌM KIẾM (BINARY SEARCH TREE - BST).........................................................127
  • 3. iii 9.5. PHÉP BĂM (HASH)............................................................................................................................... 132 9.6. KHOÁ SỐ VỚI BÀI TOÁN TÌM KIẾM ................................................................................................ 133 9.7. CÂY TÌM KIẾM SỐ HỌC (DIGITAL SEARCH TREE - DST)............................................................ 133 9.8. CÂY TÌM KIẾM CƠ SỐ (RADIX SEARCH TREE - RST) .................................................................. 136 9.9. NHỮNG NHẬN XÉT CUỐI CÙNG ...................................................................................................... 140 PHẦN 3. QUY HOẠCH ĐỘNG .................................................................... 143 §1. CÔNG THỨC TRUY HỒI ..........................................................................................................144 1.1. VÍ DỤ ...................................................................................................................................................... 144 1.2. CẢI TIẾN THỨ NHẤT........................................................................................................................... 145 1.3. CẢI TIẾN THỨ HAI............................................................................................................................... 147 1.4. CÀI ĐẶT ĐỆ QUY ................................................................................................................................. 147 §2. PHƯƠNG PHÁP QUY HOẠCH ĐỘNG ...................................................................................149 2.1. BÀI TOÁN QUY HOẠCH ..................................................................................................................... 149 2.2. PHƯƠNG PHÁP QUY HOẠCH ĐỘNG ................................................................................................ 149 §3. MỘT SỐ BÀI TOÁN QUY HOẠCH ĐỘNG ............................................................................153 3.1. DÃY CON ĐƠN ĐIỆU TĂNG DÀI NHẤT ........................................................................................... 153 3.2. BÀI TOÁN CÁI TÚI............................................................................................................................... 158 3.3. BIẾN ĐỔI XÂU ...................................................................................................................................... 160 3.4. DÃY CON CÓ TỔNG CHIA HẾT CHO K............................................................................................ 164 3.5. PHÉP NHÂN TỔ HỢP DÃY MA TRẬN............................................................................................... 169 3.6. BÀI TẬP LUYỆN TẬP........................................................................................................................... 172 PHẦN 4. CÁC THUẬT TOÁN TRÊN ĐỒ THỊ .......................................... 177 §1. CÁC KHÁI NIỆM CƠ BẢN .......................................................................................................178 1.1. ĐỊNH NGHĨA ĐỒ THỊ (GRAPH) .......................................................................................................... 178 1.2. CÁC KHÁI NIỆM................................................................................................................................... 179 §2. BIỂU DIỄN ĐỒ THỊ TRÊN MÁY TÍNH ..................................................................................181 2.1. MA TRẬN KỀ (ADJACENCY MATRIX)............................................................................................. 181 2.2. DANH SÁCH CẠNH (EDGE LIST) ...................................................................................................... 182 2.3. DANH SÁCH KỀ (ADJACENCY LIST) ............................................................................................... 183 2.4. NHẬN XÉT............................................................................................................................................. 184 §3. CÁC THUẬT TOÁN TÌM KIẾM TRÊN ĐỒ THỊ ...................................................................186 3.1. BÀI TOÁN .............................................................................................................................................. 186 3.2. THUẬT TOÁN TÌM KIẾM THEO CHIỀU SÂU (DEPTH FIRST SEARCH)...................................... 187 3.3. THUẬT TOÁN TÌM KIẾM THEO CHIỀU RỘNG (BREADTH FIRST SEARCH) ............................ 189 3.4. ĐỘ PHỨC TẠP TÍNH TOÁN CỦA BFS VÀ DFS ................................................................................ 192 §4. TÍNH LIÊN THÔNG CỦA ĐỒ THỊ ..........................................................................................193 4.1. ĐỊNH NGHĨA ......................................................................................................................................... 193 4.2. TÍNH LIÊN THÔNG TRONG ĐỒ THỊ VÔ HƯỚNG ........................................................................... 194
  • 4. iv 4.3. ĐỒ THỊ ĐẦY ĐỦ VÀ THUẬT TOÁN WARSHALL ...........................................................................194 4.4. CÁC THÀNH PHẦN LIÊN THÔNG MẠNH ........................................................................................197 §5. VÀI ỨNG DỤNG CỦA DFS và BFS ......................................................................................... 207 5.1. XÂY DỰNG CÂY KHUNG CỦA ĐỒ THỊ............................................................................................207 5.2. TẬP CÁC CHU TRÌNH CƠ SỞ CỦA ĐỒ THỊ......................................................................................210 5.3. BÀI TOÁN ĐỊNH CHIỀU ĐỒ THỊ ........................................................................................................210 5.4. LIỆT KÊ CÁC KHỚP VÀ CẦU CỦA ĐỒ THỊ......................................................................................214 §6. CHU TRÌNH EULER, ĐƯỜNG ĐI EULER, ĐỒ THỊ EULER ............................................. 217 6.1. BÀI TOÁN 7 CÁI CẦU ..........................................................................................................................217 6.2. ĐỊNH NGHĨA..........................................................................................................................................217 6.3. ĐỊNH LÝ .................................................................................................................................................217 6.4. THUẬT TOÁN FLEURY TÌM CHU TRÌNH EULER...........................................................................218 6.5. CÀI ĐẶT .................................................................................................................................................219 6.6. THUẬT TOÁN TỐT HƠN......................................................................................................................221 §7. CHU TRÌNH HAMILTON, ĐƯỜNG ĐI HAMILTON, ĐỒ THỊ HAMILTON .................. 224 7.1. ĐỊNH NGHĨA..........................................................................................................................................224 7.2. ĐỊNH LÝ .................................................................................................................................................224 7.3. CÀI ĐẶT .................................................................................................................................................225 §8. BÀI TOÁN ĐƯỜNG ĐI NGẮN NHẤT..................................................................................... 229 8.1. ĐỒ THỊ CÓ TRỌNG SỐ.........................................................................................................................229 8.2. BÀI TOÁN ĐƯỜNG ĐI NGẮN NHẤT .................................................................................................229 8.3. TRƯỜNG HỢP ĐỒ THỊ KHÔNG CÓ CHU TRÌNH ÂM - THUẬT TOÁN FORD BELLMAN .........231 8.4. TRƯỜNG HỢP TRỌNG SỐ TRÊN CÁC CUNG KHÔNG ÂM - THUẬT TOÁN DIJKSTRA ...........233 8.5. THUẬT TOÁN DIJKSTRA VÀ CẤU TRÚC HEAP .............................................................................236 8.6. TRƯỜNG HỢP ĐỒ THỊ KHÔNG CÓ CHU TRÌNH - SẮP XẾP TÔ PÔ..............................................239 8.7. ĐƯỜNG ĐI NGẮN NHẤT GIỮA MỌI CẶP ĐỈNH - THUẬT TOÁN FLOYD...................................242 8.8. NHẬN XÉT .............................................................................................................................................244 §9. BÀI TOÁN CÂY KHUNG NHỎ NHẤT ................................................................................... 248 9.1. BÀI TOÁN CÂY KHUNG NHỎ NHẤT ................................................................................................248 9.2. THUẬT TOÁN KRUSKAL (JOSEPH KRUSKAL - 1956) ...................................................................248 9.3. THUẬT TOÁN PRIM (ROBERT PRIM - 1957)....................................................................................253 §10. BÀI TOÁN LUỒNG CỰC ĐẠI TRÊN MẠNG...................................................................... 257 10.1. CÁC KHÁI NIỆM .................................................................................................................................257 10.2. MẠNG THẶNG DƯ VÀ ĐƯỜNG TĂNG LUỒNG ............................................................................260 10.3. THUẬT TOÁN FORD-FULKERSON (L.R.FORD & D.R.FULKERSON - 1962) .............................262 10.4. THUẬT TOÁN PREFLOW-PUSH (GOLDBERG - 1986) ..................................................................266 10.5. MỘT SỐ MỞ RỘNG.............................................................................................................................272 §11. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI TRÊN ĐỒ THỊ HAI PHÍA .................................... 280 11.1. ĐỒ THỊ HAI PHÍA (BIPARTITE GRAPH) .........................................................................................280 11.2. BÀI TOÁN GHÉP ĐÔI KHÔNG TRỌNG VÀ CÁC KHÁI NIỆM .....................................................280 11.3. THUẬT TOÁN ĐƯỜNG MỞ ...............................................................................................................281 11.4. CÀI ĐẶT ...............................................................................................................................................282
  • 5. v §12. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI VỚI TRỌNG SỐ CỰC TIỂU TRÊN ĐỒ THỊ HAI PHÍA - THUẬT TOÁN HUNGARI .................................................................................................288 12.1. BÀI TOÁN PHÂN CÔNG .................................................................................................................... 288 12.2. PHÂN TÍCH .......................................................................................................................................... 288 12.3. THUẬT TOÁN...................................................................................................................................... 289 12.4. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI VỚI TRỌNG SỐ CỰC ĐẠI TRÊN ĐỒ THỊ HAI PHÍA....... 298 12.5. NÂNG CẤP........................................................................................................................................... 299 §13. BÀI TOÁN TÌM BỘ GHÉP CỰC ĐẠI TRÊN ĐỒ THỊ.........................................................304 13.1. CÁC KHÁI NIỆM................................................................................................................................. 304 13.2. THUẬT TOÁN EDMONDS (1965) ..................................................................................................... 305 13.3. THUẬT TOÁN LAWLER (1973)......................................................................................................... 307 13.4. CÀI ĐẶT ............................................................................................................................................... 309 13.5. ĐỘ PHỨC TẠP TÍNH TOÁN............................................................................................................... 313 TÀI LIỆU ĐỌC THÊM.................................................................................. 315