2018年4月23日

LeetCode第[22]题(Java):Generate Parentheses

摘要: 题目:制造括号序列 难度:Medium 题目内容: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 翻译: 给定n对括号,写一个函数来生成所 阅读全文

posted @ 2018-04-23 23:16 清风吹斜阳 阅读(307) 评论(0) 推荐(0) 编辑

LeetCode第[21][23]题(Java):Merge Sorted Lists

摘要: 题目:合并两个已排序链表 难度:Easy 题目内容: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of th 阅读全文

posted @ 2018-04-23 19:25 清风吹斜阳 阅读(297) 评论(0) 推荐(0) 编辑

动态查找与静态查找的区分

摘要: 1、静态查找 首先无论是静态查找还是动态查找,都要有查找的对象,也就是包含很多同类型数据的“表”,这个“表”可以理解为一个由同类型数据元素组成的一个“集合”,该集合可以用各种容器来存储,例如数组、链表、树等,我们统称这些存储数据的数据结构为——查找表。可见,查找表有时是我们传统意义的表,有时候是很复 阅读全文

posted @ 2018-04-23 17:14 清风吹斜阳 阅读(7737) 评论(0) 推荐(1) 编辑

2018年4月22日

LeetCode第[20]题(Java):Valid Parentheses

摘要: 题目:有效的括号序列 难度:Easy 题目内容: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An inp 阅读全文

posted @ 2018-04-22 18:40 清风吹斜阳 阅读(1266) 评论(0) 推荐(0) 编辑

LeetCode第[19]题(Java):Remove Nth Node From End of List(删除链表的倒数第N个节点)

摘要: 题目:删除链表的倒数第N个节点 难度:Medium 题目内容: Given a linked list, remove the n-th node from the end of list and return its head. 翻译:给定一个链表,删除倒数第n个节点并返回其头部。 Example 阅读全文

posted @ 2018-04-22 16:35 清风吹斜阳 阅读(234) 评论(0) 推荐(0) 编辑

LeetCode第[17]题(Java):Letter Combinations of a Phone Number

摘要: 题目:最长公共前缀 难度:EASY 题目内容: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. 阅读全文

posted @ 2018-04-22 12:07 清风吹斜阳 阅读(357) 评论(0) 推荐(0) 编辑

2018年4月21日

LeetCode第[14]题(Java): Longest Common Prefix

摘要: 题目:最长公共前缀 难度:EASY 题目内容: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an 阅读全文

posted @ 2018-04-21 22:51 清风吹斜阳 阅读(318) 评论(0) 推荐(0) 编辑

2018年4月19日

java中HashMap、HashTable、TreeMap的区别总结【表格对比清楚明了】

摘要: 底层 有序否 键值对能否为Null 遍历 线程安全 哈希Code Hashmap 数组+链表 无序 都可null iterator 不安全 内部hash方法 Hashtable 数组+链表 无序 都不可null Enumeration(iterator) 安全 Key自己的 TreeMap 红黑树 阅读全文

posted @ 2018-04-19 23:55 清风吹斜阳 阅读(198) 评论(0) 推荐(0) 编辑

关于JDK1.8 HashMap扩容部分源码分析

摘要: 今天回顾hashmap源码的时候发现一个很有意思的地方,那就是jdk1.8在hashmap扩容上面的优化。 首先大家可能都知道,1.8比1.7多出了一个红黑树化的操作,当然在扩容的时候也要对红黑树进行重排,然而今天要说的并不是这个,而是针对数组中的链表项的处理优化。 关于hashmap的源码都十分精 阅读全文

posted @ 2018-04-19 23:41 清风吹斜阳 阅读(4112) 评论(1) 推荐(3) 编辑

2018年4月18日

LeetCode第[13]题(Java):Roman to Integer

摘要: 题目:罗马数字转换 题目难度:easy 题目内容:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman 阅读全文

posted @ 2018-04-18 23:48 清风吹斜阳 阅读(279) 评论(0) 推荐(0) 编辑

导航