- 博客(16)
- 资源 (3)
- 收藏
- 关注
转载 基于ActiveMQ的消息中间件系统 OneMM逻辑与物理架构设计详解
1. 基本介绍与组件架构图维基百科对消息中间件的定义是“Message-oriented Middleware is software infrastructure focused on sending and receiving messages between distributed system。”分布式系统中实现消息发送和接受的基础设施。随着企业信息化建设的不断深入,多种业
2015-09-30 19:54:13 942
原创 LeetCode Maximal Rectangle(dp)
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.题意:给出一个由字符0和1组成的二维字符数组,找到最大的矩阵,其所有字符为1思路:动态规划,用left[n]表示所在行的第n个元素的左边界为1的下
2015-09-29 21:44:35 1093
原创 LeetCode Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every elemen
2015-09-23 22:52:58 462
原创 LeetCode Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you
2015-09-22 23:16:44 451
原创 python2和python3中的range区别
python2中的range返回的是一个列表python3中的range返回的是一个迭代值 for i in range(1,10)在python2和python3中都可以使用,但是要生成1-10的列表,就需要用list(range(1,10))在python核心编程中要输出abcde的子序列,如果用(python3)s = 'abcde'i = -1for i in [Non
2015-09-19 22:23:14 16124
原创 CPTTRN2 - Character Patterns (Act 2)
Using two characters: . (dot) and * (asterisk) print a frame-like pattern.InputYou are given t - the number of test cases and for each of the test cases two positive integers: l - the number o
2015-09-12 23:15:24 774
原创 CPTTRN1 - Character Patterns (Act 1)
Using two characters: . (dot) and * (asterisk) print a chessboard-like pattern. The first character printed should be * (asterisk).InputYou are given t - the number of test cases and for each
2015-09-12 18:25:52 1422
原创 STRHH - Half of the half
Given a sequence of 2*k characters, please print every second character from the first half of the sequence. Start printing with the first character.InputIn the first line of input your are gi
2015-09-11 00:03:34 987
原创 Life, the Universe, and Everything
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input a
2015-09-09 22:51:35 1271
原创 LeetCode Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element
2015-09-05 12:26:58 483
原创 最大子数组乘积算法
给出一数组a,求最大子数组乘积算法思路:用动态垃规划.用maxValue(n)表示从0到n的最大子数组乘积,minValue(n)表示从0到n的最小子数组乘积。状态转移方程为:minValue(n)= min{minValue(n-1)*a[n], maxValue(n-1)*a[n], a[n]}maxValue(n)=max{minValue(n-1)*a[n], maxVal
2015-09-05 11:59:36 2000
原创 LeetCode Maximum Product Subarray(最大子数组乘积)
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the larges
2015-09-04 12:20:16 588
原创 最大子段和
给出一个数组,求其最大子数组和(要求最少取一个元素)主要是用动态规划法,用dp(n)表示从0到n之间的最大子数组和。其状态转移方程为dp(n)=dp(n-1)代码如下:class Solution {public: int maxSubArray(vector& nums) { int res = numeric_limits::min(); int sum = 0;
2015-09-04 11:07:43 1226
原创 LeetCode Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1]
2015-09-03 22:51:34 535
原创 LeetCode Merge Intervals
Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].题意:给出一些区间段,求其合并后的区间段思路:排序时,[a,b]首先a最小的排在前面,如果起始相
2015-09-03 22:14:34 465
原创 LeetCode Minimum Path Sum(动态规划)
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right whichminimizes the sum of all numbers along its path.Note: You can only move either down or right
2015-09-03 09:55:25 417
Ubuntu Linux实用学习教程.pdf
2009-09-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人