由于水平原因,博客大部分内容摘抄于网络,如有错误或者侵权请指出,本人将尽快修改

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: 参考链接:https://www.cnblogs.com/usec/p/7413829.html 使用二维数组的时候,有时候事先并不知道数组的大小,因此就需要动态的申请内存。常见的申请内存的方法有两种:malloc/free 和 new/delete。 一、malloc/free (1)申请一维数组 阅读全文
posted @ 2019-08-15 09:52 小纸条 阅读(3192) 评论(0) 推荐(0)
摘要: 参考链接:https://blog.csdn.net/lxt_Lucia/article/details/81206439 我们之前探讨过的很多算法都是利用问题的可划分性以及子问题之间的相似性来进行归纳,降低求解的复杂度,动态规划也不例外。每个子问题的求解过程都构成一个“阶段”。在完成前个阶段的计算 阅读全文
posted @ 2019-07-13 10:45 小纸条 阅读(235) 评论(0) 推荐(0)
摘要: 就是为了干倒二分题目。 题目 475. Heaters Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the 阅读全文
posted @ 2019-06-18 22:52 小纸条 阅读(507) 评论(0) 推荐(0)
摘要: 参考链接:https://www.cnblogs.com/Kohinur/p/8947142.html 链式前向星 vector存储 阅读全文
posted @ 2019-06-10 20:24 小纸条 阅读(190) 评论(0) 推荐(0)
摘要: Given an integer n, return the number of trailing zeroes in n!. Example 1: Example 2: 题目问阶乘的结果有几个零,如果用笨方法求出阶乘然后再算 0 的个数会超出时间限制。 然后我们观察一下,5 的阶乘结果是 120, 阅读全文
posted @ 2019-06-06 14:10 小纸条 阅读(98) 评论(0) 推荐(0)
摘要: Shuffle a set of numbers without duplicates. Example: 阅读全文
posted @ 2019-06-01 15:34 小纸条 阅读(117) 评论(0) 推荐(0)
摘要: Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique q 阅读全文
posted @ 2019-06-01 14:43 小纸条 阅读(116) 评论(0) 推荐(0)
摘要: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2019-06-01 11:23 小纸条 阅读(86) 评论(0) 推荐(0)
摘要: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 阅读全文
posted @ 2019-05-31 19:21 小纸条 阅读(109) 评论(0) 推荐(0)
摘要: Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? (1)定义快慢指针得到链 阅读全文
posted @ 2019-05-31 19:09 小纸条 阅读(84) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页