上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
摘要: LeetCode 28 找出字符串中第一个匹配项的下标 1. 题目地址 https://leetcode.cn/problems/find-the-index-of-the-first-occurrence-in-a-string/?envType=study-plan-v2&envId=top-i 阅读全文
posted @ 2023-10-09 09:45 夏目^_^ 阅读(17) 评论(0) 推荐(0)
摘要: LeetCode 58 最后一个单词的长度 1. 题目地址 https://leetcode.cn/problems/length-of-last-word/description/?envType=study-plan-v2&envId=top-interview-150 2. 题解 这道题由于要 阅读全文
posted @ 2023-10-09 09:38 夏目^_^ 阅读(17) 评论(0) 推荐(0)
摘要: LeetCode 13 罗马数字转整数 1. 题目地址 https://leetcode.cn/problems/roman-to-integer/description/ 2. 题解 这道题的解题过程非常简单,具体如下: 1. 我们需要将罗马数字对应的数,存到一个哈希表中。待用到时,直接使用即可。 阅读全文
posted @ 2023-10-07 22:00 夏目^_^ 阅读(13) 评论(0) 推荐(0)
摘要: LeetCode 121 买卖股票的最佳时机 1. 题目地址 https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/?envType=study-plan-v2&envId=top-interview-150 2. 题解 这道题由于 阅读全文
posted @ 2023-10-06 23:06 夏目^_^ 阅读(18) 评论(0) 推荐(0)
摘要: LeetCode 169 多数元素 1. 题目地址 2. 题解 这题有一个比较简单的做法:使用哈希表 1. 将数组中的元素全部遍历一遍。 2. 在遍历过程中,将元素存放在哈希表中,同时记录出现次数。 3. 最后遍历哈希表,如果该元素出现的次数大于一半,那么就输出该元素即可。 但是上述的做法有缺陷,空 阅读全文
posted @ 2023-10-05 21:15 夏目^_^ 阅读(30) 评论(0) 推荐(0)
摘要: LeetCode 26 删除有序数组中的重复项 1. 题目地址 https://leetcode.cn/problems/remove-duplicates-from-sorted-array/description/?envType=study-plan-v2&envId=top-intervie 阅读全文
posted @ 2023-10-04 18:41 夏目^_^ 阅读(13) 评论(0) 推荐(0)
摘要: LeetCode 27 移除元素 1. 题目地址 https://leetcode.cn/problems/remove-element/description/?envType=study-plan-v2&envId=top-interview-150 2. 题解 这道题主要采用的是快慢指针的思想 阅读全文
posted @ 2023-10-04 18:07 夏目^_^ 阅读(24) 评论(0) 推荐(0)
摘要: LeetCode 88 合并两个有序数组 1. 题目地址 https://leetcode.cn/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150 2. 题解 这道题跟归并排序 阅读全文
posted @ 2023-10-04 17:36 夏目^_^ 阅读(26) 评论(0) 推荐(0)
摘要: VLAN Trunk 1. 目的 实现相同Vlan在不同交换机上可以进行通信。 2. 原理 要想实现不同交换机之间,同一vlan的通信。此时,就需要在交换机之间设置Trunk链路(在交换机的两个接口上设置接口模式为trunk)。上图的PC0和PC3为vlan1。上图的PC1和PC2为vlan2。我们 阅读全文
posted @ 2023-10-02 20:50 夏目^_^ 阅读(74) 评论(0) 推荐(0)
摘要: 方法 代码: //example.go package test import "fmt" type User struct { Name string Id int } //定义方法,该方法是User结构体的方法 //这里面是值传递 func (u User) printName() { fmt. 阅读全文
posted @ 2023-10-02 20:11 夏目^_^ 阅读(13) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页