摘要:快速求正整数次幂,当然不能直接死乘。举个例子: 3 ^ 999 = 3 * 3 * 3 * … * 3 直接乘要做998次乘法。但事实上可以这样做,先求出2^k次幂: 3 ^ 2 = 3 * 3 3 ^ 4 = (3 ^ 2) * (3 ^ 2) 3 ^ 8 = (3 ^ 4) * (3 ^ 4) 3 ^ 16 = (3 ^ 8) * (3 ^ 8) 3 ^ 32 = (3 ^ 16)...
阅读全文
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->using System; using System.Collections.Generic; using System.Text; using System.Collections;...
阅读全文
摘要:插入排序 Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace...
阅读全文
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->using System; using System.Collections.Generic; using System.Text; namespace bishi { pu...
阅读全文