![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法
文章平均质量分 52
肖橘猫
这个作者很懒,什么都没留下…
展开
-
python实现:无刻度的一大一小水罐取水问题
问题描述:You have two jugs: a A-gallon jug and a B-gallon jug ( A > B ). Neither of the jugs have markings on them. There is a pump that can be used to fill the jugs with water. How can you get exactly C g原创 2017-10-27 20:31:36 · 923 阅读 · 0 评论 -
0-1背包问题
http://blog.csdn.net/mu399/article/details/7722810转载 2017-10-27 20:49:13 · 199 阅读 · 0 评论 -
基数排序法(radix sorting)
基数排序(radix sort)属于“分配式排序”(distribution sort),又称“桶子法”(bucket sort)或bin sort,顾名思义,它是透过数项(item)的位(digit),将要排序的元素分配至某些“桶”中,藉以达到排序的作用。基数排序法是属于稳定性的排序,其时间复杂度为O (nlog(r)m),其中r为所采取的基数,而m为堆数,在某些时候,基数排序法的效率高于其它的稳原创 2017-10-18 13:26:33 · 583 阅读 · 0 评论 -
用python实现零钱找零的三种方法
python实现零钱找零。分别采用了递归、caching递归和动态规划三种方法。原创 2017-10-26 15:23:56 · 14160 阅读 · 1 评论 -
骑士巡游问题:常规解法与启发式方法优化
The knight’s tour puzzle is played on a chess board with a single chess piece, the knight. The object of the puzzle is to find a sequence of moves that allow the knight to visit every square on the boa原创 2017-12-20 13:24:18 · 3045 阅读 · 2 评论 -
python实现二分搜索树以及改进后的AVL Tree
二分搜索树讲解 python代码:class TreeNode(object): def __init__(self, key, val, parent=None, left_child=None, right_child=None): self.key = key self.val = val self.parent = parent原创 2017-12-05 15:46:54 · 441 阅读 · 0 评论 -
【悬而未决的算法题】marker下来等待解决(随时更新)
1.Find a Sudoku puzzle in the local newspaper. Write a program to solve the puzzle. 2.Given a list of numbers in random order, write an algorithm that works in O(nlog(n))O(nlog(n)) to find the kth sm原创 2017-10-18 21:21:55 · 358 阅读 · 0 评论