自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

原创 关于leetcode上课程表的学习

题目描述代码及其实验结果public class Solution { public bool CanFinish(int numCourses, int[][] prerequisites) { int[] inNum = new int [numCourses]; Dictionary<int, List<int>> dic = new Dictionary<int ,List<int>>();

2020-05-19 22:32:00 129

原创 关于leetcode上对称二叉树的学习

题目介绍代码及其实验结果递归法:构建一个函数IsSymmetry函数比较是否镜像对称,递归求解。/** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode righ...

2020-04-28 20:13:44 134

原创 关于leetcode上相同的树的学习

题目介绍代码及其实验结果递归法:直接比较。/** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode right; * public TreeNode(...

2020-04-28 19:43:10 101

原创 关于LeetCode上只出现一次的数字的学习

题目介绍代码及其实验结果

2020-04-13 20:45:52 171

原创 关于leetcode上无重复字符的最长子串的学习

题目介绍代码及其实验结果public class Solution { public int LengthOfLongestSubstring(string s) { List<char> a=new List<char>(); int n = s.Length; int max=0; for(i...

2020-04-13 19:27:48 80

原创 关于Leetcode上反转字符串的学习

题目介绍代码及其实验结果public class Solution { public void ReverseString(char[] s) { int len=s.Length; char temp; for(int i=0;i<len/2;i++) { temp=s[i]; ...

2020-04-04 15:50:57 87

原创 关于LeetCode上最长公共前缀的学习

题目介绍代码及其实验结果public class Solution { public string LongestCommonPrefix(string[] strs) { if(strs.Length==0) { return ""; } string result=""; fo...

2020-04-04 15:31:11 70

原创 关于leetcode上滑动窗口最大值的学习

题目介绍代码及其实验结果暴力解决法public class Solution { public int[] MaxSlidingWindow(int[] nums, int k) { int n = nums.Length; if (n * k == 0) return new int[0]; int...

2020-03-30 21:32:30 73

原创 关于leetcode上整数反转的学习

题目介绍代码及其实验结果

2020-03-30 20:31:58 85

原创 关于leetcode上最小栈的学习

题目介绍代码及其实验结果public class MinStack { Stack<int> stack=new Stack<int>(); Stack<int> minStack=new Stack<int>(); /** initialize your data structure here. */ publ...

2020-03-23 21:06:39 69

原创 关于leetcode上逆波兰表达式求值

题目介绍代码及其实验结果public class Solution { public int EvalRPN(string[] tokens) { Stack<int> s = new Stack<int>(); for(int i=0;i<tokens.Length;i++) { ...

2020-03-23 19:59:21 70

原创 关于leetcode上有效的括号的学习

题目介绍

2020-03-23 17:45:20 76

原创 关于leetcode上环形链表的学习

题目介绍

2020-03-16 20:03:58 75

原创 关于leetcode上删除排序链表中重复的元素

题目介绍思路直接法,首先指针指向头结点,后面如果有重复的元素,则指向其下一个结点,直到出现null结束。代码及其实验结果/** * Definition for singly-linked list. * public class ListNode { * public int val; * public ListNode next; * public ...

2020-03-15 20:38:34 75

原创 关于leetcode上合并两个有序链表的学习

题目介绍代码实验结果

2020-03-15 20:23:39 87

原创 关于“leetcode”上买卖股票的最佳时机II的学习

题目介绍一次遍历public class Solution { public int MaxProfit(int[] prices) { int s=0; for(int i=0;i<prices.Length-1;i++) { if(prices[i]<=prices[i+1]) ...

2020-03-08 18:34:31 67

原创 数据结构与算法之猜数字

题目介绍代码using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 猜数字{ class Program { static void Main(string[] args) { Ra...

2020-03-04 17:39:33 379

原创 关于leetcode“合并两个有序数组”的学习

题目介绍解决方法代码实验结果

2020-03-01 14:56:51 68

原创 关于leetcode“最大子序和”的学习

题目介绍解题思路代码

2020-02-29 11:33:55 98

原创 关于leetcoded“买卖股票的最佳时机”的学习

题目介绍解决方法首先定义两个变量,一个最大值max=0,一个最小值min=int.MaxValue;然后进行for循环,比较找出数组内最小值以及各元素与最小值差的最大值,从而解决问题。代码public class Solution { public int MaxProfit(int[] prices) { int max=0; int min=...

2020-02-29 11:24:13 83

原创 关于leetcode上“删除排序数组中的重复项”的学习

public class Solution { public int RemoveDuplicates(int[] nums) { if(nums.Length==0) return 0; int n=0; for(int i=1;i<nums.Length;i++) { if(n...

2020-02-23 16:51:03 84

原创 关于leetcode“移除元素”的学习

public class Solution { public int RemoveElement(int[] nums, int val) { int count=0; for(int i=0;i<nums.Length;i++) { if(nums[i]!=val) { ...

2020-02-23 16:50:03 107

原创 关于leetcode上“两数之和”的学习

class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { int lenth=nums.size(); for(int i=0;i<lenth;i++) { for(int j=i+1;...

2020-02-23 16:47:14 121

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除