随笔分类 -  数据结构与算法

摘要:![](https://img2023.cnblogs.com/blog/1892439/202309/1892439-20230903134550482-1463950412.png) ![](https://img2023.cnblogs.com/blog/1892439/202309/1892 阅读全文
posted @ 2023-09-03 13:47 Chenyi_li 阅读(1) 评论(0) 推荐(0) 编辑
摘要:学习:https://www.bilibili.com/video/BV1fp4y1D7cj/?spm_id_from=333.788.top_right_bar_window_history.content.click&vd_source=46d50b5d646b50dcb2a208d3946b1 阅读全文
posted @ 2023-08-30 15:52 Chenyi_li 阅读(10) 评论(0) 推荐(0) 编辑
摘要:学习:https://www.bilibili.com/video/BV1tZ4y1Y7dF/?spm_id_from=333.337.search-card.all.click&vd_source=46d50b5d646b50dcb2a208d3946b1598 堆排序: https://www. 阅读全文
posted @ 2023-08-30 14:25 Chenyi_li 阅读(25) 评论(0) 推荐(0) 编辑
摘要:本文整合了一些大佬的文章加上自己的一些认识,供自己复习 转载:https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/solutions/8753/yi-ge-fang-fa-tuan-mie-6-dao-gu-piao-wen-ti 阅读全文
posted @ 2022-11-02 18:37 Chenyi_li 阅读(18) 评论(0) 推荐(0) 编辑
摘要:leetcode topK频率词 class Solution { public int[] topKFrequent(int[] nums, int k) { int[] result = new int[k]; HashMap<Integer, Integer> map = new HashMa 阅读全文
posted @ 2022-10-23 10:50 Chenyi_li 阅读(49) 评论(0) 推荐(0) 编辑
摘要:自己版: package leetcode.mySort; public class QuickSort { public static int partition(int[] array,int start,int end){ int base = array[start]; while (sta 阅读全文
posted @ 2022-10-22 19:51 Chenyi_li 阅读(21) 评论(0) 推荐(0) 编辑
摘要:自己造轮子 class LRUCache { // 题根据目要求函数 get 和 put 必须以 O(1) 的平均时间复杂度运行,所以一定需要用到HashMap。 // 同时,需要删除最久未使用,也就是说需要保留顺序,需要用到队列,并且插入删除复杂度O(1),所以需要用到链表(双向)实现的队列 // 阅读全文
posted @ 2022-10-14 16:45 Chenyi_li 阅读(11) 评论(0) 推荐(0) 编辑
摘要:转载: https://blog.csdn.net/KingGue/article/details/123335283?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault% 阅读全文
posted @ 2022-09-29 16:06 Chenyi_li 阅读(52) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.cn/problems/combination-sum/solution/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-2/ https://www.pudn.com/news/627ded6c5981aa38ef 阅读全文
posted @ 2022-09-02 16:29 Chenyi_li 阅读(3) 评论(0) 推荐(0) 编辑
摘要:def merge(arr,tempArr,left,mid,right): # 标记左半区第一个未排序的元素 l_pos = left # 标记右半区第一个未排序的元素 r_pos = mid + 1 # 临时数组元素的下标 pos = left # 合并 while l_pos <= mid a 阅读全文
posted @ 2022-06-14 10:43 Chenyi_li 阅读(22) 评论(0) 推荐(0) 编辑
摘要:求素数 public class Main { public static void main(String[] args) { for (int i = 2; i < 1000; i++) { if (isSimple(i)){ System.out.println(i); } } } publi 阅读全文
posted @ 2022-04-14 10:15 Chenyi_li 阅读(37) 评论(0) 推荐(0) 编辑
摘要:转载参考:https://blog.csdn.net/weixin_43059934/article/details/123316433 https://zhuanlan.zhihu.com/p/438909352 牛客练习网址:https://ac.nowcoder.com/acm/contest 阅读全文
posted @ 2022-04-08 15:12 Chenyi_li 阅读(185) 评论(0) 推荐(0) 编辑
摘要:class Solution: def topKFrequent(self, words, k): v1_dict = {} for i in words: v1_dict[i] = v1_dict.get(i,0)+1 data = sorted(v1_dict.items(),key=lambd 阅读全文
posted @ 2022-04-08 11:16 Chenyi_li 阅读(21) 评论(0) 推荐(0) 编辑
摘要:转载大佬的链接 import java.util.*; public class Main { /** * 组合数和杨辉三角:第i行第j列的数都是组合数C(i, j) (i,j从0开始) C(n, 1) = n --> 对应从左向右看斜着的第二列! > 一定有解 由于杨辉三角左右对称(C(a, b) 阅读全文
posted @ 2022-03-18 20:00 Chenyi_li 阅读(62) 评论(0) 推荐(0) 编辑
摘要:参考:https://blog.csdn.net/Promise_Lv_2019/article/details/106318649 阅读全文
posted @ 2022-03-07 14:20 Chenyi_li 阅读(23) 评论(0) 推荐(0) 编辑
摘要:# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def 阅读全文
posted @ 2022-02-14 22:09 Chenyi_li 阅读(25) 评论(0) 推荐(0) 编辑
摘要:参考:https://leetcode-cn.com/u/leetcode-solution 阅读全文
posted @ 2022-02-03 21:17 Chenyi_li 阅读(35) 评论(0) 推荐(0) 编辑
摘要:递归的办法: 动态规划: 迭代: 选自:https://www.bilibili.com/video/BV1AB4y1w7eT 阅读全文
posted @ 2021-10-16 11:12 Chenyi_li 阅读(23) 评论(0) 推荐(0) 编辑
摘要:转载:https://www.cnblogs.com/cthon/p/9251909.html 阅读全文
posted @ 2021-03-08 16:31 Chenyi_li 阅读(45) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.cnblogs.com/AlgrithmsRookie/p/5919164.html https://www.cnblogs.com/fivestudy/p/10217887.html #一、简单递归的实现 #include "stdafx.h" #include <s 阅读全文
posted @ 2021-02-19 20:27 Chenyi_li 阅读(212) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示