随笔分类 - 算法
摘要:Contains Duplicate IIIGiven an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennum...
阅读全文
摘要:Contains Duplicate IIGiven an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[...
阅读全文
摘要:Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas...
阅读全文
摘要:AVL树参考了:http://www.cppblog.com/cxiaojia/archive/2012/08/20/187776.html修改了其中的错误,代码实现并亲自验证过。 平衡二叉树(Balanced Binary Tree)是二叉查找树的一个进化体,也是第一个引入平衡概念的二叉树。19...
阅读全文
摘要:1, 二叉树结构struct TreeNode{ int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {...
阅读全文
摘要:转载自董的博客本文链接地址:http://dongxicheng.org/structure/knapsack-problems/1 背包问题介绍背包问题不单单是一个简单的算法问题,它本质上代表了一大类问题,这类问题实际上是01线性规划问题,其约束条件和目标函数如下:自从dd_engi在2007年推...
阅读全文
摘要:1 /* Jeff Somers 2 * 3 * Copyright (c) 2002 4 * 5 * jsomers@alumni.williams.edu 6 * or 7 * allagash98@yahoo.com 8 * 9 * April, 2002 10...
阅读全文

浙公网安备 33010602011771号