正在加载图片...
An algorithm:merge sort Merge sort: Cut it into two halves with equal size. Suppose 2 divides n for simplicity. Suppose the two halves are sorted:Merge them. Use two pointers,one for each half,to scan them, during which course do the appropriate merge. How to sort each of the two halves?Recursively. 4An algorithm: merge sort ◼ Merge sort: ❑ Cut it into two halves with equal size. ◼ Suppose 2 divides 𝑛 for simplicity. ❑ Suppose the two halves are sorted: Merge them. ◼ Use two pointers, one for each half, to scan them, during which course do the appropriate merge. ❑ How to sort each of the two halves? Recursively. 4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有