leetcode 60 Permutation Sequence ----- java
摘要:The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequence
阅读全文
leetcode 59 Spiral Matrix II ------ java
摘要:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3, You should return the followi
阅读全文
Linux 下开源RXTX库的配置与使用
摘要:由于项目需要再Linux下读取串口并进行相关操作。 一般串口操作(Linux)都是用C语言编写的,因为更加底层,也更安全,更易编写,但是由于项目是java的,所以就要使用java的相关库来实现。 我在这里使用的是RXTXcomm.jar。 http://rxtx.qbang.org/wiki/ind
阅读全文
leetcode 58 Length of Last Word ----- java
摘要:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word
阅读全文
leetcode 57 Insert Interval ----- java
摘要:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia
阅读全文
leetcode 56 Merge Intervals ----- java
摘要: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]. 这道题就是合并所有集
阅读全文
leetcode 55 Jump Game ----- java
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Given an array of non-negative integers, you ar
阅读全文
使用NTP获取网络时间-----java
摘要:在做系统对时的时候,需要使用到ntp来获取时间。 可以使用common-net包来获取ntp服务器的时间(即可以向那些标准时间服务器对时,也可以向自己设置好的ntp服务器进行对时)。 使用java获取ntp的时间(t1,t2,t3,t4)。下面是官网上给出的关于使用common-net关于ntp部分
阅读全文
leetcode 54 Spiral Matrix ----- java
摘要:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: You s
阅读全文