2019年2月22日

hashset和hashmap的区别

摘要: HashMap和HashSet的区别是Java面试中最常被问到的问题。如果没有涉及到Collection框架以及多线程的面试,可以说是不完整。而Collection框架的问题不涉及到HashSet和HashMap,也可以说是不完整。HashMap和HashSet都是collection框架的一部分, 阅读全文

posted @ 2019-02-22 18:08 shaer 阅读(543) 评论(0) 推荐(0) 编辑

141. Linked List Cycle(判断l链表是否有环)(leetcode)

摘要: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文

posted @ 2019-02-22 17:34 shaer 阅读(146) 评论(0) 推荐(0) 编辑

88. Merge Sorted Array(归并两个数组)(leetcode)

摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and num 阅读全文

posted @ 2019-02-22 17:06 shaer 阅读(100) 评论(0) 推荐(0) 编辑

345. Reverse Vowels of a String(交换元音字母)(leetcode)

摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Example 2: Input: "leetcode" Output: "leotcede" Exam 阅读全文

posted @ 2019-02-22 14:58 shaer 阅读(149) 评论(0) 推荐(0) 编辑

633. Sum of Square Numbers(平方和)(leetcode)

摘要: 题目: Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: 方法二:数学方法 阅读全文

posted @ 2019-02-22 14:56 shaer 阅读(158) 评论(0) 推荐(0) 编辑

14. Longest Common Prefix(最长公共前缀)(leetcode)

摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文

posted @ 2019-02-22 09:47 shaer 阅读(135) 评论(0) 推荐(0) 编辑

导航