09 2016 档案
摘要:最近再学习java的web编程,发现用java创建一个小的服务器和客户端是如此的简单,引用经典图书《Tomcat与Java Web开发技术详解(第二版)》(孙卫琴) 根据书中案例敲代码自己学习,放这里记录一下,以便复习:) 服务器端程序,接收客户端程序发出的HTTP请求,把它打印到控制台,然后解析
阅读全文
摘要:题目: Given an array of integers, every element appears three times except for one. Find that single one. Your algorithm should have a linear runtime co
阅读全文
摘要:A、 good and abc B、 good and gbc C、 test ok and abc D、 test ok and gbc 答案:B 解析:我也像很多人一样,上了就像选D。但敲到eclipse中试了下,的确输出B。很神奇!百度了一下,这就是所谓的java只有值传递,没有引用传递。 就
阅读全文
摘要:题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 题目只有一句话:把一个按升序排列的数组,装换成一个平衡二叉树。 代码: 很久没研究数据结构了,先
阅读全文
摘要:题目: 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 seq
阅读全文
摘要:题目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Ca
阅读全文
摘要:题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3
阅读全文
摘要:题目: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return 代码: 仔细一看,规律就是本层第一个和最后一个的元素都是1,其他的元素分别等于上一层同
阅读全文
摘要:题目: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spac
阅读全文