- 博客(73)
- 资源 (1)
- 收藏
- 关注
原创 leetcode 713. Subarray Product Less Than K & leetcode 467. Unique Substrings in Wraparound String
写在前面两道类似的题目,解法不一样(哭笑不得.jpg),一道用slidingwindow解,一道DP。713. Subarray Product Less Than K题目描述Your are given an array of positive integers nums.Count and print the number of (contiguous) subar...
2018-03-02 21:30:46
469
原创 最小堆的C++实现
写在前面闲来无事写了个C++版本的最小堆,堆的底层采用数组,基本的上浮和下沉过程请参考算法导论,非常简单。这里不再画图解释,具体的实现代码如下。代码实现template<typename T>class PriorityQueue {private: vector<T> heap;public: PriorityQueue() { ...
2018-02-27 13:18:56
996
原创 A* 寻路算法
写在前面再来填一个坑。之前一直说要写的A* 终于有空补上了,本篇博客首先会介绍最基础的A* 实现,在简单A* 的基础上,尝试实现稍复杂的A* 算法(带有高度信息的地形,允许对角线寻路等)。A*算法简介本博客不准备探讨A* 算法的原理,这里仅仅对A*算法做一个简单介绍,对具体原理感兴趣的同学请查阅相关资料。A* 算法是一种启发式搜索算法。本质上来讲,可以算作是广度优先搜索算法的改
2018-02-03 15:27:58
3553
原创 leetcode 773. Sliding Puzzle
写在前面好久没写算法题题解了,实在太忙了。每周的contest都有在做,本周的contest 第二题第三题都算比较有趣的题目,也都A了,先整理一下第三题的解题思路。题目描述On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented b
2018-01-28 18:01:11
1892
原创 状态模式与有限状态机 &行为树(游戏开发)
写在前面 - (更新)游戏AI的实现通常分为两种,有限状态机(FSM)以及行为树,我们这里首先将有限状态机应用到游戏《古月》的怪物AI设计中,在之后的版本中再用行为树替换有限状态机。 2018.1.11更新 目前正在写行为树的实现,预计本周内完成行为树的设计,会更新在博客中,博主目前找到了武汉胡莱游戏的实习工作,预计会实习到6月份,希望能够有所提升。有限状态机(FSM)我们知
2017-12-26 00:03:24
6706
2
原创 leetcode 653. Two Sum IV - Input is a BST
leetcode 653. Two Sum IV - Input is a BST
2017-10-14 19:06:11
435
原创 leetcode 540. Single Element in a Sorted Array
leetcode 540. Single Element in a Sorted Array
2017-10-14 18:05:03
311
原创 leetcode 406. Queue Reconstruction by Height
leetcode 406. Queue Reconstruction by Height
2017-10-09 23:02:11
264
原创 leetcode 552. Student Attendance Record II & 600. Non-negative Integers without Consecutive Ones
leetcode 552. Student Attendance Record II & 600. Non-negative Integers without Consecutive Ones
2017-09-15 21:54:36
521
原创 leetcode 316. Remove Duplicate Letters
leetcode 316 remove duplicate letters
2017-09-09 15:27:28
324
原创 leetcode 25. Reverse Nodes in k-Group & leetcode 92. Reverse Linked List II
leetcode 25. Reverse Nodes in k-Group
2017-08-28 19:47:20
385
原创 leetcode 667. Beautiful Arrangement II
leetcode 667. Beautiful Arrangement II
2017-08-28 19:37:33
2404
原创 leetcode 34. Search for a Range (binary search std::lower_bound)
leetcode 34. search for a range
2017-08-24 11:45:10
325
原创 leetcode 354. Russian Doll Envelopes & leetcode 300 Longest Increasing Subsequence
leetcode 354. Russian Doll Envelopes & leetcode 300 Longest Increasing Subsequence
2017-07-28 15:08:51
306
原创 leetcode 363. Max Sum of Rectangle No Larger Than K
leetcode 363 Max Sum of Rectangle No Larger Than K
2017-07-22 21:58:41
388
原创 leetcode 131. Palindrome Partitioning
leetcode 131 palindrome partitioning
2017-07-20 23:52:47
249
原创 leetcode 560. Subarray Sum Equals K & leetcode 1. Two Sum
leetcode 560. Subarray Sum Equals K & leetcode 1. Two Sum
2017-07-05 21:34:12
1506
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人