2017年12月23日

Longest Substring Without Repeating Characters

摘要: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文

posted @ 2017-12-23 21:31 夜的第八章 阅读(164) 评论(0) 推荐(0) 编辑

letter combinations of a phone number(回溯)

摘要: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文

posted @ 2017-12-23 20:02 夜的第八章 阅读(191) 评论(0) 推荐(0) 编辑

remove Nth Node from linked list从链表中删除倒数第n个元素

摘要: Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After rem 阅读全文

posted @ 2017-12-23 16:46 夜的第八章 阅读(426) 评论(0) 推荐(0) 编辑

generate parentheses(生成括号)

摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 给 阅读全文

posted @ 2017-12-23 15:48 夜的第八章 阅读(165) 评论(0) 推荐(0) 编辑

排序算法入门之堆排序(Java实现)

摘要: 堆排序 在学习了二叉堆(优先队列)以后,我们来看看堆排序。堆排序总的运行时间为O(NlonN)。 堆的概念 堆是以数组作为存储结构。 可以看出,它们满足以下规律: 设当前元素在数组中以R[i]表示,那么(下标从0开始), (1) 它的左孩子结点是:R[2*i+1]; (2) 它的右孩子结点是:R[2 阅读全文

posted @ 2017-12-23 10:16 夜的第八章 阅读(607) 评论(0) 推荐(0) 编辑

导航