- 博客(18)
- 收藏
- 关注
原创 用递归函数和栈逆序一个栈
class reversestack{ public: int getlast() { int res = s.top(); s.pop(); if(s.empty()) return res; else { int last = getlast(); ...
2019-08-06 13:38:53
155
转载 isstringstream and getline
https://blog.youkuaiyun.com/jacky_chenjp/article/details/70233212 https://www.cnblogs.com/xiaofeiIDO/p/8574042.html
2019-06-10 14:44:44
243
原创 leetcode328 奇偶链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* od...
2019-06-04 09:58:09
167
原创 leetcode员工的重要性
/* // Employee info class Employee { public: // It's the unique ID of each node. // unique id of this employee int id; // the importance value of this employee int importance; ...
2019-05-29 11:33:45
282
1
原创 按之字形打印二叉树
class Solution { public: vector<vector<int> > Print(TreeNode* pRoot) { vector<vector<int>> v1; vector<int> v2; if(pRoot == nullptr) ...
2019-05-15 21:58:35
134
1
原创 重新安排行程
class Solution { public: vector<string> findItinerary(vector<vector<string>>& tickets) { vector<string> res; unordered_map<string, multiset<string...
2019-05-05 18:12:59
408
3
原创 leetcode 课程表
class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { int length = prerequisites.size(); vector<int> c(length, 0); ...
2019-05-02 13:27:09
235
1
原创 leetcode 997
class Solution { public: int findJudge(int N, vector<vector<int>>& trust) { if(trust.size() == 1) return trust[0][1]; vector<int> dout(N, 0); ...
2019-04-29 17:15:36
289
1
原创 kMp算法(有大坑)
class Solution { public: int strStr(string haystack, string needle) { if(haystack.size() == needle.size() && haystack == needle) return 0; if(haystack.size() &l...
2019-04-26 11:07:53
159
1
原创 前k个高频单词
class Solution { public: vector<string> topKFrequent(vector<string>& words, int k) { map<string, int> mp; for(int i =0; i < words.size(); i++) { ...
2019-04-24 18:04:40
301
2
原创 和为k的子数组的个数
class Solution { public: int subarraySum(vector<int>& nums, int k) { if(nums.empty()) return 0; map<int, int> mp; mp[0] = -1; int sum = ...
2019-04-23 17:01:58
827
2
原创 和为k的最长子数组
class Solution { public: int subarraySum(vector<int>& nums, int k) { if(nums.empty()) return 0; map<int, int> mp; mp[0] = -1; int sum = ...
2019-04-23 16:49:07
1035
原创 leetcode 最长回文子串
class Solution { public: string longestPalindrome(string s) { return manachar(s); } string manachar(string &s) { char b[2002]; int p[2002]; int len ...
2019-04-16 21:41:41
101
1
原创 牛客剑指offer,栈的压入弹出
class Solution { public: bool IsPopOrder(vector<int> pushV,vector<int> popV) { bool bPossible =false; int nLength = pushV.size(); if(!pushV.empty() && !...
2019-04-11 17:06:17
91
2
原创 牛客刷题,反转链表
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* ReverseList(ListNode* pHead) { if(pHead == nullp...
2019-04-09 21:33:17
324
2
转载 第一次牛刀小试darknet安装
首先在网上找了很多文章,想试着训练自己的数据集,辗转后,最终找到如下两篇可供参考。 期间找教程配置也是遇到很多坑,特此记录下。 首先是下载了一个没带sln的darknet,要想办法生成吧,就找教程生成exe文件,发现配置起来实在麻烦(也可能是搞错了),最后找到开源的sln文件。见第二条链接。 进入sln后,无法生成exe文件。(这里以前已经配置过opencv,无法生成也是摸不着头脑)一度怀...
2019-03-15 12:58:06
145
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人