
数据结构—哈希表
文章平均质量分 63
death_ray
这个作者很懒,什么都没留下…
展开
-
Two Sum - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers原创 2017-05-20 17:33:32 · 184 阅读 · 0 评论 -
最长回文串
给出一个包含大小写字母的字符串。求出由这些字母构成的最长的回文串的长度是多少。数据是大小写敏感的,也就是说,"Aa" 并不会被认为是一个回文串。 注意事项假设字符串的长度不会超过 1010。您在真实的面试中是否遇到过这个题? Yes样例给出 s = "abccccdd" 返回 7一种可以构建出来的最长回文串方案原创 2017-05-20 17:39:55 · 382 阅读 · 0 评论 -
Strings Homomorphism
Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another原创 2017-05-20 17:42:26 · 910 阅读 · 1 评论 -
两数组的交
两数组的交 描述 笔记 数据 评测返回两个数组的交 注意事项Each element in the result must be unique.The result can be in any order.您在真实的面试中是否遇到过这个题? Yes样例nums1原创 2017-05-20 17:45:37 · 202 阅读 · 0 评论 -
两数组的交 II
两数组的交 II 描述 笔记 数据 评测计算两个数组的交 注意事项每个元素出现次数得和在数组里一样答案可以以任意顺序给出您在真实的面试中是否遇到过这个题? Yes样例nums1 = [1, 2, 2, 1], nums2 = [2, 2], 返回 [2,原创 2017-05-20 17:50:22 · 255 阅读 · 0 评论 -
哈希函数
描述 笔记 数据 评测在数据结构中,哈希函数是用来将一个字符串(或任何其他类型)转化为小于哈希表大小且大于等于零的整数。一个好的哈希函数可以尽可能少地产生冲突。一种广泛使用的哈希函数算法是使用数值33,假设任何字符串都是基于33的一个大整数,比如:hashcode("abcd") = (ascii(a) * 333 + ascii(b) * 332 + asci原创 2017-05-20 17:53:00 · 514 阅读 · 0 评论