上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: Question: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 阅读全文
posted @ 2018-03-08 19:07 于淼 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 在慕课上学习了一个关于java注解的课程,下面是笔记以及一些源码。 Annotation——注解 1.JDK中的注解 JDK中包括下面三种注解: @Override:标记注解(marker annotation),重写,父类写的方法,如果子类继承了父类,就要重写父类的方法。 @Deprecated: 阅读全文
posted @ 2018-03-07 20:30 于淼 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Question: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. Divide two integers without 阅读全文
posted @ 2018-03-07 12:23 于淼 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Question: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. Th 阅读全文
posted @ 2018-03-07 10:37 于淼 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Question: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than o 阅读全文
posted @ 2018-03-05 11:32 于淼 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Question: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Tips: 将k个有序的链表合并成为一个有序链表。 思路: 这个题目是将两个链表合 阅读全文
posted @ 2018-03-05 10:13 于淼 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Question: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-bal 阅读全文
posted @ 2018-03-01 12:44 于淼 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Question: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Tips: 给 阅读全文
posted @ 2018-02-28 23:14 于淼 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Question: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' 阅读全文
posted @ 2018-02-27 16:48 于淼 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Question: Sort a linked list using insertion sort. Tips: 使用插入排序,对一个链表进行排序。 思路: 新建一个头结点newHead,设置一个pre指针,指向newHead。 cur指针,指向原来的头结点head。 当pre.next的值大于cu 阅读全文
posted @ 2018-02-27 12:04 于淼 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页