会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
itdef
2021年2月28日
程序员面试金典 <Cracking the Coding Interview> 面试题 02.06. 回文链表 双指针 数组
摘要: 地址 https://leetcode-cn.com/problems/palindrome-linked-list-lcci/ 编写一个函数,检查输入的链表是否是回文的。 示例 1: 输入: 1->2 输出: false 示例 2: 输入: 1->2->2->1 输出: true 解答 由于指针的
阅读全文
posted @ 2021-02-28 21:08 itdef
阅读(74)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 02.03. 删除中间节点
摘要: 地址 https://leetcode-cn.com/problems/delete-middle-node-lcci/ 实现一种算法,删除单向链表中间的某个节点(即不是第一个或最后一个节点),假定你只能访问该节点。 示例: 输入:单向链表a->b->c->d->e->f中的节点c 结果:不返回任何
阅读全文
posted @ 2021-02-28 20:57 itdef
阅读(76)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 01.06. 字符串压缩
摘要: 地址 https://leetcode-cn.com/problems/compress-string-lcci/ 字符串压缩。利用字符重复出现的次数,编写一种方法,实现基本的字符串压缩功能。比如,字符串aabcccccaaa会变为a2b1c5a3。若“压缩”后的字符串没有变短,则返回原先的字符串。
阅读全文
posted @ 2021-02-28 16:55 itdef
阅读(90)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 01.04. 回文排列 哈希
摘要: 地址 https://leetcode-cn.com/problems/palindrome-permutation-lcci/ 给定一个字符串,编写一个函数判定其是否为某个回文串的排列之一。 回文串是指正反两个方向都一样的单词或短语。排列是指字母的重新排列。 回文串不一定是字典当中的单词。 示例1
阅读全文
posted @ 2021-02-28 16:13 itdef
阅读(109)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 01.03. URL化 配图
摘要: 地址 https://leetcode-cn.com/problems/string-to-url-lcci/solution/ URL化。编写一种方法,将字符串中的空格全部替换为%20。假定该字符串尾部有足够的空间存放新增字符,并且知道字符串的“真实”长度。(注:用Java实现的话,请使用字符数组
阅读全文
posted @ 2021-02-28 16:07 itdef
阅读(92)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 01.02. 判定是否互为字符重排 哈希
摘要: 地址 https://leetcode-cn.com/problems/check-permutation-lcci/submissions/ 给定两个字符串 s1 和 s2,请编写一个程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。 示例 1: 输入: s1 = "abc", s2
阅读全文
posted @ 2021-02-28 15:40 itdef
阅读(88)
评论(0)
推荐(0)
程序员面试金典 <Cracking the Coding Interview> 面试题 01.01. 判定字符是否唯一 哈希
摘要: 地址 https://leetcode-cn.com/problems/is-unique-lcci/ 实现一个算法,确定一个字符串 s 的所有字符是否全都不同。 示例 1: 输入: s = "leetcode" 输出: false 示例 2: 输入: s = "abc" 输出: true 限制:
阅读全文
posted @ 2021-02-28 15:05 itdef
阅读(139)
评论(0)
推荐(0)
导航
博客园
首页
新随笔
联系
订阅
管理
公告