摘要:问题:配置Spring的时候容易发生如题的这样一个经常性的错误,错误如下(以context为例) 再看看beans的约束: 咦?这不是有context的声明吗, 没错,不过还少了一些东西,那就是关于context的xsi的模式地址 xsi:schemaLocation 的更新 xmlns:全名是xm
阅读全文
摘要:题目:制造括号序列 难度:Medium 题目内容: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 翻译: 给定n对括号,写一个函数来生成所
阅读全文
摘要:题目:合并两个已排序链表 难度: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
阅读全文
摘要:1、静态查找 首先无论是静态查找还是动态查找,都要有查找的对象,也就是包含很多同类型数据的“表”,这个“表”可以理解为一个由同类型数据元素组成的一个“集合”,该集合可以用各种容器来存储,例如数组、链表、树等,我们统称这些存储数据的数据结构为——查找表。可见,查找表有时是我们传统意义的表,有时候是很复
阅读全文
摘要:题目:有效的括号序列 难度:Easy 题目内容: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An inp
阅读全文
摘要:题目:删除链表的倒数第N个节点 难度:Medium 题目内容: Given a linked list, remove the n-th node from the end of list and return its head. 翻译:给定一个链表,删除倒数第n个节点并返回其头部。 Example
阅读全文
摘要:题目:最长公共前缀 难度:EASY 题目内容: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.
阅读全文
摘要:题目:最长公共前缀 难度:EASY 题目内容: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an
阅读全文
摘要:底层 有序否 键值对能否为Null 遍历 线程安全 哈希Code Hashmap 数组+链表 无序 都可null iterator 不安全 内部hash方法 Hashtable 数组+链表 无序 都不可null Enumeration(iterator) 安全 Key自己的 TreeMap 红黑树
阅读全文
摘要:今天回顾hashmap源码的时候发现一个很有意思的地方,那就是jdk1.8在hashmap扩容上面的优化。 首先大家可能都知道,1.8比1.7多出了一个红黑树化的操作,当然在扩容的时候也要对红黑树进行重排,然而今天要说的并不是这个,而是针对数组中的链表项的处理优化。 关于hashmap的源码都十分精
阅读全文
摘要:题目:罗马数字转换 题目难度: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
阅读全文
摘要:题目连接:http://codecraft.devcloud.huaweicloud.com/home/detail 比赛历程:找了室友和一个电院的朋友组队,一共差不多一个月的时间,平时一般白天做自己的事,晚上花一两个小时写写改改,期间每一个星期找一天晚上一起讨论一下 下周的工作计划。 由于本次比赛
阅读全文
摘要:结构体大小的计算,。网上说法一大堆还都不一样分什么对齐不对齐,偏移量什么的。。 在此稍微举例简单总结下: 对齐原则:每一成员的结束偏移量需对齐为后一成员类型的倍数 补齐原则:最终大小补齐为成员中最大值的倍数 拿个题目做例子:【(开始偏移量)+此处字节 = 结束偏移量】 1 struct MyStru
阅读全文