数据结构与算法学习笔记 教你字节跳动算法面试破冰 落日映苍穹つ 2023-09-27 12:31 51阅读 0赞 > 数据结构是程序的骨架,而算法则是程序的灵魂。 **《算法 + 数据结构 = 程序》** 是 Pascal 语言之父 Niklaus Emil Wirth写过的一本非常著名的书。而作为书名的这句话也成为了计算机科学的经典名句。可见,对于程序设计来说,算法和数据结构的关系密不可分。 在学习之前,首先我们要弄清楚什么是算法?什么是数据结构?为什么要学习算法和数据结构? 简单来说,**算法(Algorithm)** 就是解决问题的方法或者过程。如果我们把问题看成是函数,那么算法就是将输入转换为输出的过程。**数据结构(Data Structure)** 是数据的计算机表示和相应的一组操作。**程序(Program)** 则是算法和数据结构的具体实现。 如果我们把「程序设计」比作是做菜的话,那么「数据结构」就是食材和调料,「算法」则是不同的烹饪方式,或者可以看作是菜谱。不同的食材和调料,不同的烹饪方式,有着不同的排列组合。同样的东西,由不同的人做出来,味道自然也是千差万别。 至于为什么要学习算法和数据结构? 还是拿做菜举例子。我们做菜,讲究的是「色香味」俱全。程序设计也是如此,对于待解决的问题,我们追求的是:**选择更加合适的「数据结构」,使用花费时间更少、占用空间更小的「算法」。** 我们学习算法和数据结构,是为了学会在编程中从时间复杂度、空间复杂度方面考虑解决方案,训练自己的逻辑思维,从而写出高质量的代码,以此提升自己的编程技能,获取更高的工作回报。 当然就像是做菜,掌握了食材和调料,学会了烹饪方式,并不意味着你就会做出一盘很好吃的炒菜。同样你掌握了算法和数据结构并不意味着你就会写程序。这需要不断的琢磨和思考,并持续学习,才能成为一名优秀的 厨师 (程序员)。 我花了一个星期将八大基础排序和链表/二叉树/栈/队列制作成一份**精美的PDF**。 下面简单介绍一下八大基础排序和基础的数据结构,+jcc4261获取每种排序的思想和基础的**讲解和源码**在PDF里边有。 ![format_png][] ![format_png 1][] ## 数据结构与算法学习笔记 ## ## 一、冒泡排序 ## ![format_png 2][] ## 二、选择排序 ## ![format_png 3][] ## 三、插入排序 ## ![format_png 4][] ## 四、快速排序 ## ![format_png 5][] ## 五、归并排序 ## ![format_png 6][] ## 六、希尔排序 ## ![format_png 7][] ## 七、堆排序 ## ![format_png 8][] ## 八、基数排序(桶排序) ## ![format_png 9][] ## 九、递归 ## ![format_png 10][] ## 十、链表 ## ![format_png 11][] ## 十一、栈 ## ![format_png 12][] ## 十二、队列 ## **数据结构\[队列\]就是这么简单** ![format_png 13][] ## 十三、二叉树 ## * **0.二叉树就是这么简单** * **1.动态创建二叉树** * **2.查询二又查找树相关** ![format_png 14][] [format_png]: https://img-blog.csdnimg.cn/img_convert/08869ebf0065667d4688a5b32b02e07c.webp?x-oss-process=image/format,png [format_png 1]: https://img-blog.csdnimg.cn/img_convert/36b784f582aa1fa65e80e89f6e3d9338.webp?x-oss-process=image/format,png [format_png 2]: https://img-blog.csdnimg.cn/img_convert/64e4e3a3ccd51d3a9fea1b3486548100.webp?x-oss-process=image/format,png [format_png 3]: https://img-blog.csdnimg.cn/img_convert/33b016778dc14d627b594d09b3031d3d.webp?x-oss-process=image/format,png [format_png 4]: https://img-blog.csdnimg.cn/img_convert/150a6f8584ba75265fc8843cf4465c54.webp?x-oss-process=image/format,png [format_png 5]: https://img-blog.csdnimg.cn/img_convert/0e26314412b50791ecda347a9df7a495.webp?x-oss-process=image/format,png [format_png 6]: https://img-blog.csdnimg.cn/img_convert/68a3a11ae2fbe874cd32333bffe67bd3.webp?x-oss-process=image/format,png [format_png 7]: https://img-blog.csdnimg.cn/img_convert/5859c6eafed6bd8dc61d21c2cfefa67a.webp?x-oss-process=image/format,png [format_png 8]: https://img-blog.csdnimg.cn/img_convert/d08fa316cf5cc24aab685743ae213069.webp?x-oss-process=image/format,png [format_png 9]: https://img-blog.csdnimg.cn/img_convert/48ffc59cd3614523ff2f444ed0e5699e.webp?x-oss-process=image/format,png [format_png 10]: https://img-blog.csdnimg.cn/img_convert/0fe471a0e94f34f43b6abba41068d0b4.webp?x-oss-process=image/format,png [format_png 11]: https://img-blog.csdnimg.cn/img_convert/97947bb98a05ca2e4ec02c49841bf15a.webp?x-oss-process=image/format,png [format_png 12]: https://img-blog.csdnimg.cn/img_convert/7510ddb099b27ae82a9b9cf6823ffe83.webp?x-oss-process=image/format,png [format_png 13]: https://img-blog.csdnimg.cn/img_convert/c700cad45dff27badef158e4c8e843e9.webp?x-oss-process=image/format,png [format_png 14]: https://img-blog.csdnimg.cn/img_convert/c367974adf28d86ab676b2d78de17566.webp?x-oss-process=image/format,png
还没有评论,来说两句吧...