
Java
文章平均质量分 67
柯莹
希望我这颗小星球能够变得更加成熟,更加strong,我要做计算界女汉子!!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
翻转一棵二叉树 + Java中queue的总结
翻转二叉树,使用Java版实现原创 2015-08-26 10:52:40 · 474 阅读 · 0 评论 -
Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. Subscribe to see wh原创 2016-09-01 16:30:53 · 212 阅读 · 0 评论 -
字符串分割--java中String.split()用法
在java.lang包中有String.split()方法,返回是一个数组。 1、“.”和“|”都是转义字符,必须得加"\\"; 如果用“.”作为分隔的话,必须是如下写法: String.split("\\."),这样才能正确的分隔开,不能用String.split("."); 如果用“|”作为分隔的话,必须是如下写法: String.split("\\|"),这样才能正确的分隔转载 2017-02-27 21:59:37 · 215 阅读 · 0 评论 -
Lintcode: 尾部的零
尾部的零 设计一个算法,计算出n阶乘中尾部零的个数 您在真实的面试中是否遇到过这个题? Yes 样例 11! = 39916800,因此应该返回 2 class Solution { /* * param n: As desciption * return: An int转载 2017-05-09 16:43:50 · 200 阅读 · 0 评论 -
Leetcode: Summary Ranges
Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. public class Solution { public List sum原创 2017-03-01 22:06:04 · 143 阅读 · 0 评论 -
剑指offer:旋转数组的最小数字
题目描述 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。 输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素。 例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。 NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。 思路 剑指Offer中有这道题目的分析。这是一道二分查找的变形的题目。原创 2016-09-13 15:01:33 · 163 阅读 · 0 评论 -
LeetCode:Reverse Linked List
Reverse a singly linked list. 思路: 注意几个地方: 变换前: h ----> i ----> j 变换后: h 1 以i节点为当前节点。假设i节点前面的节点都实现了逆转。现在已i节点为参考对象。注意需要用一个新定义的ListNode去记录下i的下一个节点j。因为如果单纯的将j的下一节点指向h,会导致i , j 之间断裂原创 2016-09-05 10:22:13 · 165 阅读 · 0 评论 -
Leetcode:Find the Difference
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was原创 2016-08-29 16:41:41 · 551 阅读 · 0 评论 -
leetcode:Contains Duplicate
217. 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 r原创 2016-06-28 17:00:35 · 202 阅读 · 0 评论 -
leetcode: Majority Element
169. Majority Element My Submissions Question Editorial Solution Total Accepted: 122095 Total Submissions: 289750 Difficulty: Easy Given an array of size n, find the majority ele原创 2016-06-23 15:01:05 · 358 阅读 · 0 评论 -
leetcode:Reverse String
344. Reverse String My Submissions Question Editorial Solution Total Accepted: 29346 Total Submissions: 50197 Difficulty: Easy Write a function that takes a string as input and r原创 2016-05-31 14:41:58 · 236 阅读 · 0 评论 -
leetcode: Maximum Depth of Binary Tree
104. Maximum Depth of Binary Tree My Submissions Question Editorial Solution Total Accepted: 149038 Total Submissions: 309044 Difficulty: Easy Given a binary tree, find its maxim原创 2016-06-04 17:59:26 · 217 阅读 · 0 评论 -
leetcode:Intersection of Two Arrays
349. Intersection of Two Arrays My Submissions Question Editorial Solution Total Accepted: 16575 Total Submissions: 36982 Difficulty: Easy Given two arrays, write a function to c原创 2016-06-10 19:20:07 · 258 阅读 · 0 评论 -
leetcode:Move Zeroes
283. Move Zeroes My Submissions Question Editorial Solution Total Accepted: 87958 Total Submissions: 196336 Difficulty: Easy Given an array nums, write a function to move all 0原创 2016-06-10 08:55:46 · 223 阅读 · 0 评论 -
leetcode: Remove Linked List Elements
203. Remove Linked List Elements My Submissions Question Editorial Solution Total Accepted: 66759 Total Submissions: 229425 Difficulty: Easy Remove all elements from a linked lis原创 2016-06-11 17:46:46 · 265 阅读 · 0 评论 -
leetcode: Same Tree
100. Same Tree My Submissions Question Editorial Solution Total Accepted: 133548 Total Submissions: 306562 Difficulty: Easy Given two binary trees, write a function to check if t原创 2016-06-12 10:25:05 · 320 阅读 · 0 评论 -
leetcode: Excel Sheet Column Title
168. Excel Sheet Column Title My Submissions Question Editorial Solution Total Accepted: 63607 Total Submissions: 286742 Difficulty: Easy Given a positive integer, return its cor原创 2016-06-12 12:29:48 · 251 阅读 · 0 评论 -
Leetcode: Find the Difference
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was原创 2017-06-26 16:12:16 · 213 阅读 · 0 评论