摘要: Lua特性 轻量级:用C语言编写,编译后仅仅一百余K 可扩展:提供了非常易于使用的扩展接口和机制 支持面向过程(procedure-oriented)编程和函数式编程(functional programming) 自动内存管理;只提供了一种通用类型的表(table),用它可以实现数组,哈希表,集合 阅读全文
posted @ 2020-10-21 21:35 cancantrbl 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 寻路算法 广度优先算法 从地图上任意一点S到其他所有可达点的最短路径,考虑上下左右四个所有方向行走的情况 openQueue存放即将搜索的结点,closeQueue存放已经搜索完后的结点 设定搜索起点S,放入openQueue中; 判断openQueue是否为空,若为空,搜索结束;若不为空,拿出op 阅读全文
posted @ 2020-10-13 22:51 cancantrbl 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 设计模式 建议看我另外的博客,里面有全套设计模型的解析:https://www.cnblogs.com/cancantrbl/category/1973800.html 面向对象三大特性 封装:把客观事物封装成抽象的类,并且类可以把自己的数据和方法只让可信的类或者对象操作,对不可信的进行信息隐藏。 阅读全文
posted @ 2020-10-13 22:48 cancantrbl 阅读(2797) 评论(0) 推荐(1) 编辑
摘要: AssetBundle游戏资源的打包 定义:AssetBundle是unity的一种资源包文件,我们可以将游戏中使用到的游戏资源打包成Assetbundle,在游戏运行时动态加载游戏资源。 动态加载Assetbundle,以及加载过程 使用静态方法Assetbundle.LoadFromFile将A 阅读全文
posted @ 2020-10-13 22:38 cancantrbl 阅读(2521) 评论(0) 推荐(2) 编辑
摘要: 322. Coin Change class Solution { public: int coinChange(vector<int>& coins, int amount) { //动态规划 // 最优解法 // 算出1-11每个数的组成需要的最少硬币数 int nums[amount+1]; 阅读全文
posted @ 2020-09-13 21:13 cancantrbl 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 21. 合并两个有序链表 - Merge Two Sorted Lists 题目:https://leetcode.com/problems/merge-two-sorted-lists/ /** * Definition for singly-linked list. * struct ListN 阅读全文
posted @ 2020-09-13 11:46 cancantrbl 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 347. Top K Frequent Elements class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { // hash map 储存frequency unordered_map<int, 阅读全文
posted @ 2020-09-12 22:00 cancantrbl 阅读(1099) 评论(0) 推荐(0) 编辑
摘要: 704. 二分查找 - Binary Search class Solution { public: int search(vector<int>& nums, int target) { int middle, left = 0; int right = nums.size()-1; while 阅读全文
posted @ 2020-09-12 13:27 cancantrbl 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 78. 子集 - Subsets 题目:https://leetcode.com/problems/subsets/ class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { vector<vector<int 阅读全文
posted @ 2020-09-11 21:36 cancantrbl 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 方法一:Insertion Sort 1 class MedianFinder { 2 vector<int> store; // resize-able 3 public: 4 /** initialize your data structure here. */ 5 MedianFinder() 阅读全文
posted @ 2020-09-11 17:26 cancantrbl 阅读(210) 评论(0) 推荐(0) 编辑