上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-10-31 05:08 微微程序媛 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-10-31 04:09 微微程序媛 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-10-31 04:08 微微程序媛 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2016-10-31 04:08 微微程序媛 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Design a Snake game that is played on a device with screen size = width x height. Play the game online if you are not familiar with the game. The snak 阅读全文
posted @ 2016-10-30 14:47 微微程序媛 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given a snake and ladder board, find the minimum number of dice throws required to reach the destination or last cell from source or 1st cell. Basical 阅读全文
posted @ 2016-10-30 13:19 微微程序媛 阅读(800) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2016-10-30 05:27 微微程序媛 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2016-10-30 04:06 微微程序媛 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 归并排序o(nlgk); 法二 : 优先队列 维护一个长为n的队列 o(n *lgk) 阅读全文
posted @ 2016-10-30 02:59 微微程序媛 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list in O(n log n) time using constant space complexity. 双链表用快排 单链表用归并 阅读全文
posted @ 2016-10-29 04:17 微微程序媛 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页