01 2018 档案

摘要:题目: Given a binary tree, return the preorder traversal of its nodes' values. 思路: 二叉树的前序遍历一般分为递归和非递归两种,非递归通过栈来存储节点。 代码: 递归: 循环: 阅读全文
posted @ 2018-01-14 23:17 Sindyang 阅读(105) 评论(0) 推荐(0)
摘要:题目: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 思路: 这道题看起来并不难,但是有很多需要注意的点,我用了很久的时间才通过这道题。大致的思路 阅读全文
posted @ 2018-01-14 20:27 Sindyang 阅读(146) 评论(0) 推荐(0)
摘要:题目: 448. Find All Numbers Disappeared in an Array Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and ot 阅读全文
posted @ 2018-01-13 20:03 Sindyang 阅读(162) 评论(0) 推荐(0)