page448.html

来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 41 行

HTML
41
字号
<HTML><HEAD><TITLE>Top-Down Algorithms: Divide-and-Conquer</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html6328" HREF="page449.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6326" HREF="page433.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6320" HREF="page447.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html6330" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H1><A NAME="SECTION0014300000000000000000">Top-Down Algorithms: Divide-and-Conquer</A></H1><P>In this section we discuss a top-down algorithmic paradigm called<em>divide and conquer</em><A NAME=32661>&#160;</A><A NAME=33437>&#160;</A>.To solve a given problem,it is subdivided into one or more subproblemseach of which is similar to the given problem.Each of the subproblems is solved independently.Finally, the solutions to the subproblems are combinedin order to obtain the solution to the original problem.<P>Divide-and-conquer algorithms are often implemented using recursion.However, not all recursive methods are divide-and-conquer algorithms.Generally, the subproblems solved by a divide-and-conquer algorithmare <em>non-overlapping</em>.<P><BR> <HR><UL> <LI> <A NAME="tex2html6331" HREF="page449.html#SECTION0014310000000000000000">Example-Binary Search</A><LI> <A NAME="tex2html6332" HREF="page450.html#SECTION0014320000000000000000">Example-Computing Fibonacci Numbers</A><LI> <A NAME="tex2html6333" HREF="page451.html#SECTION0014330000000000000000">Example-Merge Sorting</A><LI> <A NAME="tex2html6334" HREF="page452.html#SECTION0014340000000000000000">Running Time of Divide-and-Conquer Algorithms</A><LI> <A NAME="tex2html6335" HREF="page457.html#SECTION0014350000000000000000">Example-Matrix Multiplication</A></UL><HR><A NAME="tex2html6328" HREF="page449.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6326" HREF="page433.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6320" HREF="page447.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A>  <A NAME="tex2html6330" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright &#169; 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a>  All rights reserved.</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?