All Projects → qieguo2016 → Algorithm

qieguo2016 / Algorithm

Licence: mit
常用算法和数据结构讲解,面试算法题/leetcode解题,提供golang/js版本

Programming Languages

javascript
184084 projects - #8 most used programming language
go
31211 projects - #10 most used programming language
golang
3204 projects
js
455 projects

Projects that are alternatives of or similar to Algorithm

Interviews
Everything you need to know to get the job.
Stars: ✭ 54,875 (+17488.14%)
Mutual labels:  algorithm, interview, leetcode, leetcode-solutions
Leetcode
👏🏻 leetcode solutions for Humans™
Stars: ✭ 1,129 (+261.86%)
Mutual labels:  algorithm, interview, leetcode, leetcode-solutions
Leetcode
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
Stars: ✭ 45,650 (+14531.41%)
Mutual labels:  algorithm, interview, leetcode, leetcode-solutions
Leetcode
Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.
Stars: ✭ 3,090 (+890.38%)
Mutual labels:  algorithm, interview, leetcode, leetcode-solutions
Apachecn Algo Zh
ApacheCN 数据结构与算法译文集
Stars: ✭ 10,498 (+3264.74%)
Mutual labels:  algorithm, interview, leetcode, leetcode-solutions
Leetcode
LeetCode solutions, written in python and cpp(LeetCode解题报告,记录自己的leetcode成长之路)
Stars: ✭ 179 (-42.63%)
Mutual labels:  algorithm, interview, leetcode
Js Algorithms
A collection of algorithms written in javascript
Stars: ✭ 182 (-41.67%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Coderchef Kitchen
The official repository for our programming kitchen which consists of 50+ delicious programming recipes having all the interesting ingredients ranging from dynamic programming, graph theory, linked lists and much more. All the articles contain beautiful images and some gif/video at times to help clear important concepts.
Stars: ✭ 306 (-1.92%)
Mutual labels:  algorithm, interview, leetcode
D.s.a Leet
References and summary for leetcode high-frequency algorithm problems
Stars: ✭ 155 (-50.32%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Algorithms4 Common
🔥Algorithms, 4th Edition 算法4精华笔记,通俗理解,算法收集与强化。
Stars: ✭ 183 (-41.35%)
Mutual labels:  algorithm, interview, leetcode
Interviewroom
Contains all important data structure and algorithms problems asked in interviews
Stars: ✭ 207 (-33.65%)
Mutual labels:  algorithm, interview, leetcode
Leetcode Notes
LeetCode 算法解答
Stars: ✭ 172 (-44.87%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Leetcode Solutions
🏋️ Python / Modern C++ Solutions of All 2111 LeetCode Problems (Weekly Update)
Stars: ✭ 2,787 (+793.27%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Awesome Golang Algorithm
📝 LeetCode of algorithms with golang solution(updating).
Stars: ✭ 3,217 (+931.09%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Leetcode Js
用 JS 刷 LeetCode
Stars: ✭ 165 (-47.12%)
Mutual labels:  algorithm, leetcode, leetcode-solutions
Leetcode 101
LeetCode 101:和你一起你轻松刷题(C++)
Stars: ✭ 5,327 (+1607.37%)
Mutual labels:  interview, leetcode, leetcode-solutions
Coding-Practice
Coding practice, design pattern implementation in C++ and some knowledge summary.
Stars: ✭ 48 (-84.62%)
Mutual labels:  leetcode, interview, leetcode-solutions
CodingInterview
Leetcode解题、剑指offer第二版💪💪💪⛷😀
Stars: ✭ 28 (-91.03%)
Mutual labels:  leetcode, interview, leetcode-solutions
Coding-Interview-101
Solutions to LeetCode problems filtered with companies, topics and difficulty.
Stars: ✭ 21 (-93.27%)
Mutual labels:  leetcode, interview, leetcode-solutions
.codebits
📚 List of resources for Algorithms and Data Structures in Python & other CS topics @2017
Stars: ✭ 144 (-53.85%)
Mutual labels:  algorithm, interview, leetcode

算法与数据结构

用通俗易懂的语言来介绍工作和面试中常见的数据结构和算法,提供golang和js两种语言的实现。另外提供面试中常见算法题,尤其是leetcode题目的讲解和golang代码实现。

数据结构部分

跳跃表 (golang)

增加了向前指针的链表叫作跳表。跳表全称叫做跳跃表,简称跳表。跳表是一个随机化的数据结构,实质就是一种可以进行二分查找的有序链表。跳表在原有的有序链表上面增加了多级索引,通过索引来实现快速查找。跳表不仅能提高搜索性能,同时也可以提高插入和删除操作的性能。

这里采用redis底层类似的实现,在每层上增加了偏移量的记录,好处是在按排行取元素的时候可以先从上层按偏移量快速定位到目标位置,不需要在底层链表进行遍历定位。

树 (golang)

  1. B+树的简单实现(未考虑并发)
    B+ 树是一种树数据结构,是一个n叉树,每个节点通常有多个孩子,一颗B+树包含根节点、内部节点和叶子节点。根节点可能是一个叶子节点,也可能是一个包含两个或两个以上孩子节点的节点。 B+ 树通常用于数据库和操作系统的文件系统中。 NTFS, ReiserFS, NSS, XFS, JFS, ReFS 和BFS等文件系统都在使用B+树作为元数据索引。 B+ 树元素自底向上插入,其特点是能够保持数据稳定有序,其插入与修改拥有较稳定的对数时间复杂度。
  2. 字典树的构建

cache (golang)

LRU是Least Recently Used的缩写,即最近最少使用,是一种常用的页面置换算法,选择最近最久未使用的页面予以淘汰。该算法赋予每个页面一个访问字段,用来记录一个页面自上次被访问以来所经历的时间 t,当须淘汰一个页面时,选择现有页面中其 t 值最大的,即最近最久未使用的页面予以淘汰。
LFU(least frequently used (LFU) page-replacement algorithm)。即最不经常使用页置换算法,要求在页置换时置换引用计数最小的页,因为经常使用的页应该有一个较大的引用次数。但是有些页在开始时使用次数很多,但以后就不再使用,这类页将会长时间留在内存中,因此可以将引用计数寄存器定时右移一位,形成指数衰减的平均使用次数。

堆 (golang)

堆是一种带有顺序结构的完全二叉树,分为大根堆和小根堆,根据完全二叉和父子大小关系,利用数组结构比较容易实现堆结果。 golang源码中也实现了一个小根堆(代码在container/heap/),采用接口化的设计,实用性大大提升,值得好好学习一番,主要亮点:

  1. 接口化设计,只要实现heap接口即可使用
  2. 复用sort接口实现,最大程度复用
  3. 采用循环代推递归实现调整

链表 (golang)

golang实现的单链表和双链表结构和源码分析。 golang源码的双向链表实现(代码在container/list/)亮点:

  1. 双向链表为环形结构,前后指针调整方便
  2. 节点元素与链表分开两种数据结构

算法部分

做任何算法的时候,都要先弄清需求!如果是需要构造一个函数,那一定要弄清楚函数的调用方式、各参数的含义,多举几个例子说明。只有弄懂了这个函数应该是怎样的,才有可能写出符合要求的函数

LeetCode

LeetCode解题(golang)

design

sort

golang实现:

js实现:

recursive

动态规划

Array

other

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].