想编程到音乐世界灭亡
想编程到音乐世界灭亡
全部文章
分类
未归档(2)
题解(11)
归档
标签
去牛客网
登录
/
注册
想编程到音乐世界灭亡的博客
全部文章
(共10篇)
题解 | C++#易懂的快速排序#
void quick(vector<int>&arr,int low,int high) { if(arr.size()==0||arr.empty())return; if(low>=high)return;//如果low>high...
C++
快速排序
2021-08-10
0
261
题解 | C# #孩子们的游戏(圆圈中最后剩下的数)#
public int LastRemaining_Solution(int n, int m) { if(n<=0||m<1)return -1; List<int> list = new List<int>();//用List模拟循环链表 ...
C#
孩子们的游戏
2021-08-09
0
300
题解 | C# #连续子数组的最大和#
public int FindGreatestSumOfSubArray (List<int> array) {//第一次接触动态规划,看了LeetCode官方题解,觉得能理解一些了 if(array==null||array.Count==0)return 0; ...
连续子数组的最大和
C#
2021-07-30
0
403
题解 | C# #第一个只出现一次的字符#
public int FirstNotRepeatingChar(string str) { if((str==null)||str.Length==0)return -1;//好兄弟,咱们没有隔壁CharAt()可以直接用,用字典也是个方法 Dictionary&l...
第一个只出现一次的字符
C#
2021-07-30
0
339
题解 | C# #包含min函数的栈#
Stack<int> stk1 = new Stack<int>(); Stack<int> stk2 = new Stack<int>(); public void push(int node) { stk2.Push...
包含min函数的栈
C#
2021-07-30
0
381
题解 |C# #翻转单词序列#
//解决本题思路: //倒着+分次 放进栈 //原:a am I 要变成 I am a,是否可行?结果:I ma a //可以发现单词也会受到影响,换个思路,倒着放进栈? //原:a am I,结果:a am I //发现单词不受影响了,但是顺序不对 //如果分开...
翻转单词序列
C#
2021-07-29
0
306
题解 | #链表中环的入口结点#
public ListNode EntryNodeOfLoop(ListNode pHead) { //暴力哈希// HashSet<listnode> hash = new HashSet<listnode>();// w...
链表中环的入口结点
C#
2021-07-28
0
283
题解 |C# #两个链表的第一个公共节点#
如果p1==p2,则这个节点就是公共节点(注意不是值) public ListNode FindFirstCommonNode(ListNode pHead1, ListNode pHead2) { &nb...
两个链表的第一个公共节点
C#
2021-07-28
0
275
题解 |C#二分法 旋转数组的最小数字
public int minNumberInRotateArray (List<int> rotateArray) { int low = 0; i...
旋转数组的最小数字
2021-07-27
0
322
题解 | #二维数组中的查找#
using System;using System.Collections.Generic;using System.Linq;class Solution { public bool Find (int target, List<List<int>> array) {...
2021-07-24
0
316