点进Collections.reverse的代码瞄了眼,然后就开始了一些基础知识的收集. 现在发现知道的越多,知道不知道的越多. 列几个记录下: reverse方法源码: /** * Reverses the order of the elements in the specified list.<p> * * This method runs in linear time. * * @param list the list whose elements are to be reversed.
个人阅读<K&R>的感觉就是:前后内容联系特别紧密,前面的代码没有理解好到了后面就看不下去. 1.getline(char s[], int lim) 调用结果:往参数数组中读入字符直到换行(即:读取一行) 返回值:参数数组所读入的字符串长度 在<c程序设计语言中>里使用频率特别高. version 1: int getline(char s[], int lim) { int c, i; ; i < lim - && (c = getchar())
一直直到bug-free.不能错任何一点. 思路不清晰:刷两天. 做错了,刷一天. 直到bug-free.高亮,标红. 185,OA(YAMAXUN)--- (1) findFirstDuplicate string in a list of string. import java.util.HashSet; import java.util.Set; public class Solution { public static void main(String[] args) { String[
题目来源 https://leetcode.com/problems/multiply-strings/ Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 题意分析 Input: two numbers expressed as str
LeetCode第9题 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. F
题目: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 题解: 题意就是给你两个字符串型的数字,给这两个数字做乘法. 如果直接转换成Integer做乘法就会溢出. 所以要一步一步来. 下面讲解引用自(http://leetcodeno