Comments (4)
你在自底而上归并排序里面对于空间复杂度的分析有问题!
从你的描述中感觉空间复杂度只和函数递归栈有关,但是你的算法中用到一个N长度的辅助数组,其实我觉得空间复杂度为O(N)。
这是我的看法。
from goa.c.
那个手摇算法在leetcode上面使用,我觉得可以填上去。
题目:剑指Offer58-II.左旋转字符串
leetcode 还是有用的!哈哈哈哈哈哈
from goa.c.
@baici1
你在自底而上归并排序里面对于空间复杂度的分析有问题!
从你的描述中感觉空间复杂度只和函数递归栈有关,但是你的算法中用到一个N长度的辅助数组,其实我觉得空间复杂度为O(N)。
这是我的看法。
文章下面的手摇算法就节省了辅助数组的空间。如果没有原地排序,你确实可以说空间复杂度是O(N),但是根据上下文,我们讨论的是两种方法的区别,空间上的复杂度只要考虑的是递归,自顶向下空间复杂度更大。
from goa.c.
@baici1
那个手摇算法在leetcode上面使用,我觉得可以填上去。
题目:剑指Offer58-II.左旋转字符串
leetcode 还是有用的!哈哈哈哈哈哈
实际上,不是leetcode有用,你要明白这一点。
from goa.c.
Related Issues (20)
- 优先队列及堆排序
- 快速排序 HOT 5
- 查找算法
- 哈希表:散列查找
- 二叉查找树
- AVL树 HOT 1
- 2-3-4树和普通红黑树 HOT 3
- 文档部署 HOT 1
- 书籍推荐 HOT 1
- 参考
- 优先队列及堆排序目录问题 HOT 2
- 补充
- 堆合并:左偏树
- 优先队列及堆排序 HOT 3
- 纠正一处小错误 HOT 2
- 工程应用实例
- 勘误说明
- 博客title能不能加个图标,在浏览器书签有个图标好看一点点 HOT 1
- Official website address change HOT 1
- 简单入门golang-结构体和方法
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goa.c.