![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C C++
文章平均质量分 80
erdangjiade
这个作者很懒,什么都没留下…
展开
-
数的分割
问题是这样的: 如何把一个自然数分割成M部分, 每一部分都是另一个自然数的N次方. 比如,如何把81分解成三个数的平方. 答案有三个: 81=64+16+1, 81=36+36+9, 81=49+16+16. 如何把7分成四个数, 答案也是三个, 4-1-1-1, 3-2-1-1, 2-2-2-1. 这个题使用递归算法来做不难, 我在学习模板编程的时候把它作为一道练习题来做的, 姑且也放原创 2009-08-03 13:33:00 · 496 阅读 · 0 评论 -
Knight's Travel Problem on a custom sized board using double BFS Algorithm
The Original Problem:Given an 8x8 standard chess board, and the starting point and ending point, find a shortest path for a knight to travel from starting point to ending point, AND, print the pat原创 2014-03-07 14:01:20 · 1215 阅读 · 0 评论 -
Object Oriented Design -- Data and Algorithm Separation (1)
摘要:主要介绍软件设计过程中数据和算法分离的原则,以及用一个例子(可以适用于任何数据结构的通用二叉树算法)说明了具体的实现方式。这种设计思想其实与STL标准库中采用的方法很相似,不仅适用于二叉树,也适用于其他一些算法,之所以使用二叉树是人人都能理解的一种数据结构,而且算法简单。文档主体是用英文写的,可能不太通顺,请见谅。One of STL library's basic traits and原创 2014-04-03 21:09:51 · 918 阅读 · 0 评论 -
Object Oriented Design -- Data and Algorithm Separation (2)
数据与算法分离的通用二叉树的源代码。原创 2014-04-03 22:07:21 · 871 阅读 · 0 评论 -
Google Programming Test Problem SecretSum C++ 11 Solution
Well, this could be the conclusion of this topic. II just post this code here,原创 2014-05-18 20:15:47 · 564 阅读 · 0 评论 -
Crossing Bridge Problem
//// copyright DGU, gdyxgzy@hotmail.com// You can use part or whole of this code freely, provided that you keep this headert,// and provide a link to this page or send an email to my inbox listed a原创 2014-05-22 19:08:22 · 848 阅读 · 0 评论