Java/leetcode
accumulate_zhang
我好像什么都不会,真的!!!
展开
-
java 安装与环境变量的配置
https://jingyan.baidu.com/article/fea4511a12b158f7bb9125b9.htmlJava的环境变量的配置:http://www.runoob.com/java/java-environment-setup.html直接安装jdk,安装jdk的时候会自动安装jre原创 2018-01-12 20:35:50 · 237 阅读 · 0 评论 -
java中的取~运算符是怎么元算的?
首先要记住一点是,在内存中数都是以补码的形式存在的。其次 正数的二进制原码,反码,补码都是一样的。负数的补码等于反码+1,反码就是原码取反。为了方便注意符号位。看个例子~6=-7首先这个是正6取反运算的值是多少。首先6的二进制原码为 110,一般这样写,带上符号位00110,最高位为符号位0,表示正数。那么6在内存中是按它的补码存在的,正数的补码与原码相同,同原创 2018-01-12 23:12:30 · 437 阅读 · 0 评论 -
leetcode之top100_01_twoSsum/top100_20_ValidParentheses
top100第一题,是给定一个整型数组,然后给定一个target,让你求数组中两个数的和为target,然后然后返回这两数的下标索引。import java.util.HashMap;import java.util.Map;public class top100_01_twoSsum { public static int[] twoSum(int [] nums,int targ...原创 2018-03-19 10:15:42 · 283 阅读 · 0 评论 -
leetcode Top100 之MaximumSubarray/MergeTwoSortedLists
这是leetcode top 100中的21、53题第21题,将两个有序的链表,拼接在一起。package leetcodeJava.array;public class top100_21_MergeTwoSortedLists { /** * Definition for singly-linked list. * public class ListNode { * ...原创 2018-03-20 10:19:41 · 257 阅读 · 0 评论 -
leetcode top 100 的121_BestTimetoBuyandSellStock
这是leetcode top 100 的121_BestTimetoBuyandSellStock。Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction ...原创 2018-03-21 09:21:05 · 286 阅读 · 0 评论