Code Monkey home page Code Monkey logo

algorithm-go's Introduction

Algorithm-go

  1. collect leet-code multi-solution in go

练习 OJ/Leetcode 的十二重境界

1、能够把题目归类(关键字)

2、能够想到 basic idea

3、能够暴力 AC

4、能够采用不同方法解题

5、能够总结题解下不同算法的时间和空间复杂度

6、能够 step by step 搞明白 edge case, 以及其对应的的代码片段

8、能够从 brute force 算法出发,一步步提出优化点,优化到最终的 nice-done 算法

7、能够扩展题目,联系到其他不同的算法题,抽象出共同点和通用代码

7-a、能够根据测试用例,用图形化的方式动态展示代码做的事情

8、隔开一个星期,再重新回顾代码是,能够想出题目的描述以及 Limitation

9、能够改写题目, follow-up question

10、重新想另外一种解题方式

11、能否把题目的核心**和结构单独抽象出来,用于解决不同类别的问题

12、泛化题目

总结性文章

资源

1、动态规划 20 题目。 https://www.geeksforgeeks.org/top-20-dynamic-programming-interview-questions/

2、Leetcode 刷题顺序。 https://www.zhihu.com/question/36738189/answer/908664455

3、编程进阶。https://www.zhihu.com/question/356351510/answer/1148885728

4、公司编程高频题目。 https://github.com/afatcoder/LeetcodeTop

6、https://zhuanlan.zhihu.com/p/149409633

7、刷题、https://www.zhihu.com/question/399923003/answer/1300151492

9、刷 leetcode 练习题目。 https://zhuanlan.zhihu.com/p/149409633 [✅]

10、https://www.zhihu.com/question/399923003/answer/1300151492 go 语言进阶。[✅]

11、http://highscalability.com/ 【✅】【架构】

参考项目

算法刷题模板

1、go 相关数据结构, https://github.com/Workiva/go-datastructures

2、go, 题目集合。 https://github.com/lifei6671/interview-go

3、系统设计题目, https://github.com/soulmachine/system-design

4、golang 问题, https://github.com/KeKe-Li/data-structures-questions

5、top-quesiton, https://github.com/afatcoder/LeetcodeTop

6、https://github.com/shgopher/GOFamily

7、https://leetcode-cn.com/study-plan/algorithms/?progress=myeios1

8、https://talkgo.org/t/topic/1877

9、《labuladong 的算法小抄》

https://labuladong.github.io/algo/2/

10、《leetcode 101》 【✅】

11、GO-question, https://golang.design/go-questions/map/unordered/

12、算法图解/Leetcode 图解, https://www.liwei.party/

13、算法模板, https://github.com/greyireland/algorithm-pattern

14、代码随想, https://programmercarl.com/

  1. Understand Channels https://speakerd.s3.amazonaws.com/presentations/10ac0b1d76a6463aa98ad6a9dec917a7/GopherCon_v10.0.pdf

algorithm-go's People

Contributors

0xff-96 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

algorithm-go's Issues

Prefix-sum 技巧

最大众数:Majority-Element

题目索引

1- 1、https://leetcode.com/problems/majority-element/solution/

目标

1、用尽全部的解题方法,并且讲清楚其中的分析技巧
2、

思考

  • 会有多少个 majority number 呢?(有什么作用?)

性质: n/3 : 最多会只有两个 majority number

算法视频

好看的答案

20200802编程之美

编程之美

打算把这里的东西,内化一下。

数字的技巧

结构之法

数学之趣

Monotic-stack: 单调栈的应用

单调栈调应用

1、https://blog.csdn.net/zuzhiang/article/details/78134247
2、https://labuladong.gitbook.io/algo/shu-ju-jie-gou-xi-lie/dan-tiao-zhan
3、https://medium.com/algorithms-and-leetcode/monotonic-queue-explained-with-leetcode-problems-7db7c530c1d6
4、https://stackoverflow.com/questions/55780200/intuition-behind-using-a-monotonic-stack

单调栈 leetcode 题目

https://leetcode.com/problems/next-greater-element-ii/solution/

视频

1、https://www.bilibili.com/video/BV1q7411j7DS?from=search&seid=9613133216781283773 【已看】
2、https://www.bilibili.com/video/BV1q7411j7DS?from=search&seid=9613133216781283773 【单调栈和单调队列】
3、算法体 tapping water : https://www.bilibili.com/video/BV1Et411j7fd?from=search&seid=9613133216781283773
4、online stack span : https://www.youtube.com/watch?v=RGRC46zHB98

概念

什么是单调栈

单调栈,顾名思义,是栈内元素保持一定单调性(单调递增或单调递减)的栈。这里的单调递增或递减是指的从栈顶到栈底单调递增或递减。既然是栈,就满足后进先出的特点。与之相对应的是单调队列。

核心伪代码

for(i=0;i<=n;i++)
{
	if(栈为空或入栈元素大于等于栈顶元素) 入栈;
	else 
	{
		while(栈非空并且栈顶元素大于等于入栈元素)
		{
			栈顶元素出栈;
			更新结果; 
		} 
		将最后一次出栈的栈顶元素即当前元素可以拓展到的位置入栈; 
		更新最后一次出栈的栈顶元素其对应的值; 
	} 

核心描述

有一组数10,3,7,4,12。从左到右依次入栈,则如果栈为空或入栈元素值小于栈顶元素值,则入栈;否则,如果入栈则会破坏栈的单调性,则需要把比入栈元素小的元素全部出栈。单调递减的栈反之

应用

  1. 最基础的应用就是给定一组数,针对每个数,寻找它和它右边第一个比它大的数之间有多少个数
  2. 给定一序列,寻找某一子序列,使得子序列中的最小值乘以子序列的长度最大。
  3. 给定一序列,寻找某一子序列,使得子序列中的最小值乘以子序列所有元素和最大。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.