随笔分类 -  菜鸟刷题路

随缘刷题、leetcode hot 100、牛客题霸、剑指offer
摘要:16、统计出当前(titles.to_date='9999-01-01')各个title类型对应的员工当前(salaries.to_date='9999-01-01')薪水对应的平均工资。结果给出title以及平均工资avg。 CREATE TABLE `salaries` ( `emp_no` i 阅读全文 »
posted @ 2020-10-11 16:21 无名客nameless 阅读(175) 评论(0) 推荐(0) 编辑
摘要:1、查找最晚入职员工的所有信息,为了减轻入门难度,目前所有的数据里员工入职的日期都不是同一天(sqlite里面的注释为--,mysql为comment) CREATE TABLE `employees` ( `emp_no` int(11) NOT NULL, -- '员工编号' `birth_da 阅读全文 »
posted @ 2020-10-10 22:12 无名客nameless 阅读(223) 评论(0) 推荐(0) 编辑
摘要:剑指 Offer 09. 用两个栈实现队列 用两个栈实现一个队列。队列的声明如下,请实现它的两个函数 appendTail 和 deleteHead ,分别完成在队列尾部插入整数和在队列头部删除整数的功能。(若队列中没有元素,deleteHead 操作返回 -1 ) class CQueue { S 阅读全文 »
posted @ 2019-11-21 22:08 无名客nameless 阅读(56) 评论(0) 推荐(0) 编辑
摘要:剑指 Offer 06. 从尾到头打印链表 class Solution { public int[] reversePrint(ListNode head) { Stack<Integer> stack = new Stack<>(); while(head != null){ stack.pus 阅读全文 »
posted @ 2019-11-20 12:08 无名客nameless 阅读(53) 评论(0) 推荐(0) 编辑
摘要:剑指 Offer 05. 替换空格 class Solution { public String replaceSpace(String s) { StringBuilder str = new StringBuilder(s); int p1 = str.length() - 1; for(int 阅读全文 »
posted @ 2019-11-20 11:18 无名客nameless 阅读(49) 评论(0) 推荐(0) 编辑
摘要:剑指 Offer 03. 数组中重复的数字 哈希表/set class Solution { public int findRepeatNumber(int[] nums) { HashSet<Integer> set = new HashSet<>(); for(int num : nums){ 阅读全文 »
posted @ 2019-11-20 10:59 无名客nameless 阅读(50) 评论(0) 推荐(0) 编辑
摘要:lc88 class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int i = m - 1, j = n - 1; int p = m + n - 1; while(i >= 0 && j >= 0) 阅读全文 »
posted @ 2019-11-20 10:02 无名客nameless 阅读(61) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示