# LeetCodeCnNote **Repository Path**: hengbo12345/LeetCodeCnNote ## Basic Information - **Project Name**: LeetCodeCnNote - **Description**: 刷LeetCode Cn的记录,包括代码和笔记 - **Primary Language**: Go - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-12-06 - **Last Updated**: 2024-08-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LeetCodeCnNote [TOC] ## 项目介绍 刷[LeetCode Cn](https://leetcode-cn.com)的记录,包括代码和笔记 ## 更新计划 1. 会依次完成[初级算法](https://leetcode-cn.com/explore/interview/card/top-interview-questions-easy/)的所有题目。 2. 所有题目的最终成绩要求在90%以上,尽可能98%以上。 3. 整理优化思路。 4. 用golang、python、C三种语言各刷一遍。 ## 优化记录 ### Golang版本 1. rotate、remove-duplicates-from-sorted-array都需要原地替换操作,频繁的初始化tmp会导致大量的内存垃圾和初始化对象操作,影响性能。 2. rotate中存在多级循环,需注意深层循环的offset多次初始化也会导致内存垃圾和初始化对象操作,影响性能; 3. for循环的使用方式分为两种,一种类似迭代器、一种类似脚标遍历,一般而言迭代器有一定的性能优势。 4. 递归与循环的性能,一般而言,跳转和多层上下文环境会有一定的性能影响,不大。