02 2019 档案

摘要:题目 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), ne... 阅读全文
posted @ 2019-02-26 17:05 李正浩 阅读(85) 评论(0) 推荐(0) 编辑
摘要:题目 代码/*// Definition for a Node.class Node {public: int val; Node* next; Node* random; Node() {} Node(int _val, Node* _next... 阅读全文
posted @ 2019-02-26 16:20 李正浩 阅读(180) 评论(0) 推荐(0) 编辑
摘要:题目 https://leetcode-cn.com/explore/learn/card/linked-list/197/conclusion/764/代码 /*// Definition for a Node.class Node {public: int val;... 阅读全文
posted @ 2019-02-26 15:54 李正浩 阅读(226) 评论(0) 推荐(0) 编辑
摘要:[System.Obsolete("这是一条提示信息,表示这个方法弃用了,使用此方法会有一条Warning信息")]private void SaveDataMessage(SaveMessage message){}在方法上方添加特性,即可,如果想要不允许通过编译,则需要在... 阅读全文
posted @ 2019-02-25 22:12 李正浩 阅读(100) 评论(0) 推荐(0) 编辑
摘要:题目设计链表的实现。您可以选择使用单链表或双链表。单链表中的节点应该具有两个属性:val 和 next。val 是当前节点的值,next 是指向下一个节点的指针/引用。如果要使用双向链表,则还需要一个属性 prev 以指示链表中的上一个节点。假设链表中的所有节点都是 0-in... 阅读全文
posted @ 2019-02-25 20:04 李正浩 阅读(132) 评论(0) 推荐(0) 编辑
摘要:题目 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), ne... 阅读全文
posted @ 2019-02-25 19:36 李正浩 阅读(140) 评论(0) 推荐(0) 编辑
摘要:题目 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), ne... 阅读全文
posted @ 2019-02-24 16:07 李正浩 阅读(81) 评论(0) 推荐(0) 编辑
摘要:题目 代码 typedef struct SingleList {public: int val; SingleList* next; };class MyLinkedList {public: /** Initialize your data struc... 阅读全文
posted @ 2019-02-24 15:29 李正浩 阅读(94) 评论(0) 推荐(0) 编辑
摘要:题目 代码class MinStack {public: /** initialize your data structure here. */ MinStack():nums(),sorted() { } void p... 阅读全文
posted @ 2019-02-23 22:08 李正浩 阅读(103) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: int numSquares(int n) { vector dp(n + 1, INT_MAX); dp[0] = 0; for (int i = 0; i <=... 阅读全文
posted @ 2019-02-23 18:50 李正浩 阅读(143) 评论(0) 推荐(0) 编辑
摘要:题目 代码class MyCircularQueue {public: /** Initialize your data structure here. Set the size of the queue to be k. */ MyCircularQueue(... 阅读全文
posted @ 2019-02-23 15:53 李正浩 阅读(133) 评论(0) 推荐(0) 编辑
摘要:题目 代码class Solution {public: string reverseWords(string s) { for(int i=0,j=0;j<=s.size();j++) { if(j==s.size()... 阅读全文
posted @ 2019-02-23 12:09 李正浩 阅读(111) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: void reverseWords(string &s) { if (s.empty()) return; //-----判断是否不包含单词,全是空格 bool isSpace = ... 阅读全文
posted @ 2019-02-23 12:07 李正浩 阅读(115) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: vector getRow(int rowIndex) { vector array(rowIndex+1); for(int i=0;i 0; j--){ ... 阅读全文
posted @ 2019-02-23 10:24 李正浩 阅读(128) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: int minSubArrayLen(int s, vector& nums) { if(nums.empty()) return 0; int start=0,e... 阅读全文
posted @ 2019-02-23 09:57 李正浩 阅读(146) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: int findMaxConsecutiveOnes(vector& nums) { int length=0; int maxLength=0; for(int i=... 阅读全文
posted @ 2019-02-23 09:14 李正浩 阅读(254) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: int removeElement(vector& nums, int val) { int i = 0, j = 0; while(j != nums.size()) ... 阅读全文
posted @ 2019-02-22 17:08 李正浩 阅读(109) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: vector twoSum(vector& numbers, int target) { int start=0,end=numbers.size()-1; vector resul... 阅读全文
posted @ 2019-02-22 15:26 李正浩 阅读(90) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: int arrayPairSum(vector& nums) { std::sort(nums.begin(),nums.end()); int result=0; f... 阅读全文
posted @ 2019-02-22 15:10 李正浩 阅读(335) 评论(0) 推荐(0) 编辑
摘要:题目 代码class Solution {public: string addBinary(string a, string b) { int lenA = a.length(); int lenB = b.length(); string result; int a... 阅读全文
posted @ 2019-02-22 12:26 李正浩 阅读(139) 评论(0) 推荐(0) 编辑
摘要:题目 代码class Solution {public: vector findDiagonalOrder(vector>& matrix) { //判断是否为空 if(matrix.empty()) return {}; ... 阅读全文
posted @ 2019-02-10 23:29 李正浩 阅读(310) 评论(0) 推荐(0) 编辑
摘要:题目 代码 class Solution {public: vector spiralOrder(vector>& matrix) { if (matrix.empty() || matrix[0].empty()) return {}; i... 阅读全文
posted @ 2019-02-10 22:50 李正浩 阅读(153) 评论(0) 推荐(0) 编辑
摘要:题目 代码class Solution {public: int dominantIndex(vector& nums) { vector sortedNums=nums; std::sort(sortedNums.begin(),sort... 阅读全文
posted @ 2019-02-10 21:48 李正浩 阅读(286) 评论(0) 推荐(0) 编辑
摘要:效果 点击选择皮肤颜色 代码 public enum Themes { Blue, Gray, Orange } /// /// 主题颜色管理类 /// public static class ... 阅读全文
posted @ 2019-02-06 20:58 李正浩 阅读(514) 评论(0) 推荐(0) 编辑
摘要:有可能的原因如下:绑定的属性一定是属性而不能是字段,比如:public int data;是无法生效的,而public int data {get;set;}这样才能生效 阅读全文
posted @ 2019-02-04 22:30 李正浩 阅读(383) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up light_mode palette
选择主题