LeetCode
dcl_sjtu
这个作者很懒,什么都没留下…
展开
-
LeetCode 109:Convert Sorted List to Binary Search Tree
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 从给定的有序链表生成平衡二叉树。分三步:1. Get the number of nodes获取链表大小n2. make a balance原创 2016-08-04 08:49:09 · 290 阅读 · 0 评论 -
LeetCode 336. Palindrome Pairs
Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e.words[i] + words[j] is a palindrome.Example 1:Given原创 2016-08-04 11:48:17 · 294 阅读 · 0 评论