- 博客(13)
- 收藏
- 关注
转载 Java - Input & Output & FileIO
需要调用Scanner类 Scanner in = new Scanner(System.in); //Scanner类in.nextLine(); // return String regardless of spacein.next(); // return String , split with spacein.nextInt(); //return int
2017-11-26 10:27:55
391
转载 Java - final、static
Java关键字final、static使用总结 一、final 根据程序上下文环境,Java关键字final有“这是无法改变的”或者“终态的”含义,它可以修饰非抽象类、非抽象类成员方法和变量。你可能出于两种理解而需要阻止改变:设计或效率。 final类不能被继承,没有子类,final类中的方法默认是final的。 final
2017-11-26 09:44:25
251
原创 20. Valid Parentheses
Description:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()
2017-11-25 11:50:41
213
转载 Java - Stack 类
Java Stack 类栈是Vector的一个子类,它实现了一个标准的后进先出的栈。堆栈只定义了默认构造函数,用来创建一个空栈。 堆栈除了包括由Vector定义的所有方法,也定义了自己的一些方法。Stack()除了由Vector定义的所有方法,自己也定义了一些方法:序号方法描述1boolean empty() 测试
2017-11-25 10:19:19
245
原创 14. Longest Common Prefix
Description:Write a function to find the longest common prefix string amongst an array of strings.Solution:1. Firstly, judge if it is null.2. To each String in String[], use String[i] to e
2017-11-23 15:23:45
181
原创 9. Roman to Integer
Description:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Conversion Rule:基本字符IVXL
2017-11-23 06:23:41
224
转载 Java - String 类
Java String 类字符串广泛应用 在Java 编程中,在 Java 中字符串属于对象,Java 提供了 String 类来创建和操作字符串。注意:String 类是不可改变的,所以你一旦创建了 String 对象,那它的值就无法改变了(详看笔记部分解析)。如果需要对字符串做很多修改,那么应该选择使用 StringBuffer & StringBuilder 类。
2017-11-23 05:15:21
221
原创 7. Reverse Integer
这是一道基本的对数字操作的题,除却简单外还需要注重细节,这道题就是注意 Integer的溢出问题。1. 功能的实现: result = result * 10 + x % 10;2. 溢出的检测:a) The absolute value of Integer's minimum is larger 1 than Integer's maximum. To the fina
2017-11-22 15:00:31
188
转载 Java-8种排序算法
本文主要详解了Java语言的8大排序的基本思想以及实例解读,详细请看下文8种排序之间的关系:1, 直接插入排序(1)基本思想:在要排序的一组数中,假设前面(n-1)[n>=2] 个数已经是排好顺序的,现在要把第n个数插到前面的有序数中,使得这n个数也是排好顺序的。如此反复循环,直到全部排好顺序。(2)实例(3)用java实现
2017-11-13 02:12:14
203
转载 Java-Collection六类接口[Collection,Set,List,Map,Iterator,Comparable]
首先,我们先看一下Collection集合的基本结构: 1、Collection接口Collection是最基本集合接口,它定义了一组允许重复的对象。Collection接口派生了两个子接口Set和List,分别定义了Set和List两种不同的存储方式.Collection接口常见的方法如下:(1)单元素添加、删除booleanadd(Object o) /
2017-11-12 04:44:31
270
转载 机器学习入门资源不完全汇总
2014-10-14版, 好东西传送门编辑整理, 原文链接 http://ml.memect.com/article/machine-learning-guide.html感谢贡献者: tang_Kaka_back@新浪微博欢迎补充指正,转载请保留原作者和原文链接。 本文是 机器学习日报的一个专题合集,欢迎订阅:请给hao@memect.com发邮件,标题"订阅机器学习日报"。基本概念
2017-05-08 21:33:54
383
原创 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the sam
2017-03-28 12:36:35
234
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人