程序员的世界, 为程序员服务

2016-06-29
Linux操作命令(八)

该节主要讲解sort,uniq,join 命令。 这里对linux常用的命令进行整理,以便日后查看。–来自实验楼。

Read More

2016-06-29
Linux操作命令(六)

该节主要讲解wc,grep,正则表达式 命令。 这里对linux常用的命令进行整理,以便日后查看。–来自实验楼。

Read More

2016-06-29
Linux操作命令(十)

该节主要讲解df,du,time 命令。 这里对linux常用的命令进行整理,以便日后查看。–来自实验楼。

Read More

2016-06-29
LeetCode-Longest Consecutive Sequence

##题目 ####Longest Consecutive Sequence Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4. Your algorithm should run in O(n) comple

Read More

2016-06-29
Linux操作命令(四)

该节主要讲解which,whereis,locate 命令。 这里对linux常用的命令进行整理,以便日后查看。–来自实验楼。

Read More

2016-06-29
LeetCode-Longest Valid Parentheses

##题目 ####Longest Valid Parentheses Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", which has length = 2. Another exam

Read More

2016-06-29
LeetCode-Majority Element

##题目 ####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 always exist in the array. ####Credits:Special thanks to @ts for adding this p

Read More

2016-06-29
MapReduce程序日志查看

##一、实验内容首先,如果需要打印日志,不需要用log4j这些东西,直接用System.out.println即可,这些输出到stdout的日志信息可以在jobtracker站点最终找到。 其次,如果在main函数启动的时候用System.out.println打印的日志,直接在控制台就可以看到。 再其次,jobtracker站点很重要。 http://localhost:50030 注意,在这里看到Map 100%不一定正确,有时候会卡在Map阶段并没有完成,而此时居然显示Map 100%,所以要一层层的点进去,直到看到日志为止。 另外,在cluster summary表格中可以看到map/

Read More

2016-06-29
MapReduce快速入门

##一、MapReduce介绍MapReduce是一种编程模型,用于大规模数据集(大于1TB)的并行运算。概念"Map(映射)"和"Reduce(归约)",和他们的主要思想,都是从函数式编程语言里借来的,还有从矢量编程语言里借来的特性。他极大地方便了编程人员在不会分布式并行编程的情况下,将自己的程序运行在分布式系统上。 当前的软件实现是指定一个Map(映射)函数,用来把一组键值对映射成一组新的键值对,指定并发的Reduce(归约)函数,用来保证所有映射的键值对中的每一个共享相同的键组。

Read More

2016-06-29
LeetCode-Max Points on a Line

##题目 ####Max Points on a Line Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

Read More

2016-06-29
LeetCode-Maximal Rectangle

##题目 ####Maximal Rectangle Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and return its area.

Read More

2016-06-29
LeetCode-Maximum Depth of Binary Tree

##题目 ####Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

Read More

2016-06-29
Map和Reduce阶段内部细节和调节参数

##一、实验内容本节介绍Map和Reduce阶段内部细节和调节参数.

Read More

2016-06-29
LeetCode-Maximum Gap

##题目 ####Maximum Gap Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements. You may assume all elements in the array are non-negative integers and fit in the

Read More

2016-06-29
LeetCode-Maximum Product Subarray

##题目 ####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 largest product = 6.

Read More

2016-06-29
LeetCode-Maximum Subarray

##题目 ####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] has the largest sum = 6. ####More practice:If you have figured out the O(n) solu

Read More

2016-06-29
LeetCode-Merge Intervals

##题目 ####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].

Read More

2016-06-29
LeetCode-Merge Sorted Array

##题目 ####Merge Sorted Array Given two sorted integer arrays A and B, merge B into A as one sorted array. Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m and n respectively.

Read More

2016-06-29
LeetCode-Merge Two Sorted Lists

##题目 ####Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

Read More

2016-06-29
LeetCode-Merge k Sorted Lists

##题目 ####Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

Read More