Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-06-29 15:08:56
阅读次数:
263
创建表的语法:1:关于表的结构的创建 表的字段有那些,什么数据类型创建表: 主键约束(primary
key) 主键不能为空(not null) 一张表只有一个主键,修改表--标识列(identity) --主键约束(primary
key)------pk_字段名 --唯一约束(unique)--...
分类:
数据库 时间:
2014-05-30 01:40:13
阅读次数:
279
一次过,思路是:最大收益可以由所有上升序列差价叠加中获得 1 public class
Solution { 2 public int maxProfit(int[] prices) { 3 int profit = 0; 4 if
(prices.lengt...
分类:
其他好文 时间:
2014-05-29 20:43:33
阅读次数:
254
题意:所给数据中是否有负环? 没有负环的图中所有路径中最短的值思路:1. bellmanford
判断负环2.flodyWarshall 求所有定点的最短路径细节:1. bellmanford 算法时间复杂度为 o(n^3), 因为图的使用邻接矩阵存储的,
使用邻接表代码会容易理解些, 引用 wik...
分类:
其他好文 时间:
2014-05-29 20:41:30
阅读次数:
237
题意:computing a max-spacingk-clustering.spacing 是指两个
cluster 之间的最小距离输入:[number_of_nodes][edge 1 node 1] [edge 1 node 2] [edge 1
cost][edge 2 node 1] [e...
分类:
其他好文 时间:
2014-05-29 20:40:30
阅读次数:
323
都是考查DFS。经典回溯算法,问题在于我对该类型的代码不熟悉,目前以参考别人的代码,然后加上自己的实现为主,通过类似的题目加强理解。一、给定一棵二叉树,判断是否存在从root到leaf的路径和等于给定值sum,存在返回true,否则返回false。思路:DFS。代码:
1 private b...
分类:
其他好文 时间:
2014-05-28 23:51:25
阅读次数:
389
1.下载XMPPFramework,下载地址:https://github.com/robbiehanson/XMPPFramework2.创建项目并将XMPP库引入:3.添加需要的库文件:4.配置KissXML:OTHER_LDFLAGS
添加 -lxml2HEADER_SEARCH_PATHS ...
分类:
移动开发 时间:
2014-05-28 23:46:15
阅读次数:
472
Given an arraySofnintegers, are there
elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which
gives the sum of zero.Note:Elemen...
分类:
其他好文 时间:
2014-05-28 16:47:30
阅读次数:
308
问题来源于leetcode上的两道题 Path Sum I &&
II,分别写了两个dfs。1 void dfs(TreeNode node , int sum , ArrayList curPath)2 void
dfs(TreeNode node , int sum , boolean ifEx...
分类:
编程语言 时间:
2014-05-28 13:11:14
阅读次数:
361
题目: Say you have an array for which the ith element
is the price of a given stock on day i. Design an algorithm to find the maximum
profit. You may co...
分类:
其他好文 时间:
2014-05-28 00:53:26
阅读次数:
338