摘要: class Solution { public: int findMaxConsecutiveOnes(vector<int>& nums) { int count=0; int max=count; for(int i=0;i<nums.size();i++){ if(nums[i]==1) co 阅读全文
posted @ 2021-11-07 16:22 Knightl8 阅读(1) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-10-28 07:32 Knightl8 阅读(4) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector<vector<int>> levelOrder(TreeNode* root) { vector<vector<int>> v2; if(!root) return v2; vector<vector<int>> v1; queue<T 阅读全文
posted @ 2021-10-26 12:54 Knightl8 阅读(6) 评论(0) 推荐(0) 编辑
摘要: Character class 阅读全文
posted @ 2021-10-04 22:30 Knightl8 阅读(6) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> typedef struct QueueNode { int data; struct QueueNode *next; }QueueNode; typedef struct { QueueNode *front; Que 阅读全文
posted @ 2021-09-24 17:03 Knightl8 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #define MaxQueueSize 5 typedef struct{ int data[MaxQueueSize]; int front; int rear; }SeQue 阅读全文
posted @ 2021-09-24 16:08 Knightl8 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1 typedef struct { 2 3 int data[10000]; 4 int top; 5 } MinStack; 6 7 /** initialize your data structure here. */ 8 9 MinStack* minStackCreate() { 10 M 阅读全文
posted @ 2021-06-17 15:48 Knightl8 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 9 10 /** 11 * Note: The retur 阅读全文
posted @ 2021-06-17 13:57 Knightl8 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 void deleteNode(struct ListNo 阅读全文
posted @ 2021-06-17 13:51 Knightl8 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 9 10 struct ListNode* getKthF 阅读全文
posted @ 2021-06-16 16:42 Knightl8 阅读(13) 评论(0) 推荐(0) 编辑