greyireland / algorithm-pattern Goto Github PK
View Code? Open in Web Editor NEW算法模板,最科学的刷题方式,最快速的刷题路径,你值得拥有~
License: MIT License
算法模板,最科学的刷题方式,最快速的刷题路径,你值得拥有~
License: MIT License
建议加上题号
为啥我随手点开个滑动窗口的板子,和labuladong的板子内容完全相同呢。
前半部分用的JS,后半段用的TS,欢迎前端的同学来围观哈。
我个人开发了一个微信小程序,起初是做为尝试方便自己查看 GitHub 的开源项目和书籍,但是后续使用人数逐渐增多了。
考虑到小程序上展示的项目都有对应的开源许可,可能会涉及对部分项目的侵权。
我们观察到您的项目并没有在 GitHub 上设置任何的开源许可,所以想向您申请相关的许可,许可包括允许在小程序上展示和查看。
以下是小程序的二维码,可以扫码查看。
如果您觉得我已经侵犯了您的权利,请告知我,我将第一时间移除。
From WeChat Mini Programe: GitHub Trending Hub
链表中的 linked-list-cycle 问题
直接使用了节点的值进行比较
应该使用内存地址比较。
First of all, thank you so much for this wonderful repo, and also sorry for asking my question in English as inputting Chinese is too painful for me.
My question is actually not necessarily related to this repo, so please forgive me for posting such question here. I'm a bit confused regarding the leetcode links provided in this repo. It seems that the links point to the Chinese version of the leetcode site correct? What's the relation between the Chinese version site and the English version site? I ask because I'm a regular user on the English leetcode site, but I found that I wasn't able to login to the Chinese version site with my English site user name and password.
找到一个不错的链接,上面有解释和对应的题目。
算法写错了,
导致得出的子集数量比正确答案的少.
完成 | 用户 | 项目地址 |
---|---|---|
✅ | binzi56 | algorithm-pattern-c(c++ 实现) |
参考原库的实现, 感谢楼主付出;写了一遍感觉还是记不住, 等多写几遍看看;(ps:看也有pull request提了一个c++实现的, 我也自荐一下, 大部分实现都是参考原库, 方便理解;)
Q:有个小问题咨询一下, 看链接里还有两个是LintCode的, 楼主还会去LintCode刷题吗? 是如何考虑的呢?😆
链表:merge-two-sorted-lists,连接l1 未处理完节点 和 连接l2 未处理完节点,直接接非空l1或者l2不就好了么,不用for循环。
高级 /资深后端开发工程师 [30k-50k]
1 、负责电商业务相关后台研发,优化订单、商品、物流等系统方案设计和实施;
2 、负责高质量的设计和编码,承担重点、难点的技术攻坚;
3 、参与产品讨论和开发实现。
4 、对系统稳定性、可扩展性、限流降级、高可用、异步化、可测性、可回溯等方面技术架构推推进落地;
5 、对现有架构、性能进行优化。
投递邮箱:[email protected]
目前我们团队是负责直播电商这块,也是公司主推项目,明星或大佬(罗永浩)都在抖音卖货,大量招人~
最近面试难度也有相应降低,有想法的可以试试啊~,急速内推,看到消息必回!
小福利:
【三餐房补车补】【MacPro 32G】【所有软件正版激活码】【月底发当月工资】
🐶 准大三狗一枚,最近考驾照,所以零散的时间片段很多,这个时候刷刷LeetCode多香啊!
☕ 记录数据结构与算法的学习笔记以及 LeetCode 上刷过的每一道题 : https://algorithm.show
algorithm-pattern/data_structure/linked_list.md文件里的linked-list-cycle-ii对应的链接有问题
要是有C++的版本可就更好了鸭
今天在公众号上看到了大佬你这个 repo,同样是 gopher,我觉得我必须来让大佬指点指点我。小弟我去年也刷了一年 LeetCode,代码仓库在这里:https://github.com/halfrost/LeetCode-Go
🙏🏻 大佬没事也可以指点指点我,一起交流一起学习~
今年年底晚些之后我会来字节跳动面试,希望到时候有机会能和大佬做同事💪🏻
字节跳动校招内推码: [BMB4EKA]
投递链接: https://job.toutiao.com/s/JRNrUxR
提前批 QA 问题: https://mp.weixin.qq.com/s/b8NBZOU2mmeEdBAwzPjsLw
刷题&面试 攻略: https://github.com/greyireland/algorithm-pattern 🤣
原文链接
我用C++重写后提交报超时,是贴的代码有问题么,还是单纯用动态规划做不了呢
文件地址:algorithm-pattern/introduction/quickstart.md
问题strStr,问题代码:
func strStr(haystack string, needle string) int {
if len(needle) == 0 {
return 0
}
....
}
如果子串长度为0的话返回0有歧义,误认为子串起始地址为0,我觉得改为负数之类的更好。
https://github.com/greyireland/algorithm-pattern/blob/master/data_structure/linked_list.md
里面说"fast 如果初始化为 head.Next 则中点在 slow.Next
如果链表长度是偶数,返回中间偏右的位置
且fast如果初始化为head->next 返回中间偏左的位置。
但是对于奇数长度两者中点相同吧
通过此rep的模版无法通过,具体算法如下:
func decodeString(s string) string {
if len(s) == 0 {
return ""
}
stack := make([]byte, 0)
for i := 0; i < len(s); i++ {
switch s[i] {
case ']':
temp := make([]byte, 0)
for len(stack) != 0 && stack[len(stack)-1] != '[' {
v := stack[len(stack)-1]
stack = stack[:len(stack)-1]
temp = append(temp, v)
}
// pop '['
stack = stack[:len(stack)-1]
// pop num
idx := 1
for len(stack) >= idx && stack[len(stack)-idx] >= '0' && stack[len(stack)-idx] <= '9' {
idx++
}
// 注意索引边界
num := stack[len(stack)-idx+1:]
stack = stack[:len(stack)-idx+1]
count, _ := strconv.Atoi(string(num))
for j := 0; j < count; j++ {
// 把字符正向放回到栈里面
for j := len(temp) - 1; j >= 0; j-- {
stack = append(stack, temp[j])
}
}
default:
stack = append(stack, s[i])
}
}
return string(stack)
}
reverse-linked-list-ii leetcode提交不过去,可能会有空指针的现象,换个其他的解题也行
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.