GithubHelp home page GithubHelp logo

tszchingleung / algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gl-lei/algorithm

0.0 0.0 0.0 73 KB

数据结构与算法之美代码 , 原始代码 https://github.com/wangzheng0822/algo

License: MIT License

Swift 100.00%

algorithm's Introduction

algorithm

数据结构与算法之美代码使用 Swift 实现 , 原始代码 https://github.com/wangzheng0822/algo

数组

  • 实现一个支持动态扩容的数组
  • 实现一个大小固定的有序数组,支持动态增删改操作
  • 实现两个有序数组合并为一个有序数组

链表

  • 实现单链表、循环链表、双向链表,支持增删操作
  • 实现单链表反转
  • 实现两个有序的链表合并为一个有序链表
  • 实现求链表的中间结点
  • 实现求链表的倒数第K个结点(快慢指针)
  • 判断链表是否有环
  • 链表有环的话,求链表环的入口位置

  • 用数组实现一个顺序栈
  • 用链表实现一个链式栈
  • 编程模拟实现一个浏览器的前进、后退功能

队列

  • 用数组实现一个顺序队列
  • 用链表实现一个链式队列
  • 实现一个循环队列

递归

  • 编程实现斐波那契数列求值 f(n) = f(n-1) + f(n-2)
  • 编程实现求阶乘 n!
  • 编程实现一组数据集合的全排列
  • 台阶总共多少走法问题
  • 递归常见问题

排序算法

  • 冒泡排序、插入排序、选择排序
  • 归并排序、快速排序
  • 桶排序、计数排序、基数排序(未实现)
  • 编程实现O(n)时间复杂度内找到一组数据的第K大元素

二分查找

  • 实现一个有序数组的二分查找算法
  • 实现一个数的平方根求解,要求精确到小数点后六位
  • 实现模糊二分查找算法(比如大于等于给定值的第一个元素)
  • 实现循环有序数组查找给定值

跳表

  • 实现跳表

algorithm's People

Contributors

gl-lei avatar

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.