09 2018 档案

35. Search Insert Position(python)
摘要:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文

posted @ 2018-09-11 21:34 shaer 阅读(141) 评论(0) 推荐(0)

21. Merge Two Sorted Lists (python)
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文

posted @ 2018-09-10 22:50 shaer 阅读(343) 评论(0) 推荐(0)

20.Valid Parentheses (python)
摘要:这道题主要用栈来实现的。什么是栈呢,参照书上的后缀表达式的例子谈谈自己的理解,栈最明显的特征是先进后出。所以可以有效的结合题目中 ()对匹配问题,可以把从列表中获取的符号先存到栈中。 首先建个空列表用于映射栈中元素。然后挨个查询传递过来的列表的每个元素,不在栈中就压进栈,在的话再看看是不是栈顶元素。 阅读全文

posted @ 2018-09-08 23:14 shaer 阅读(190) 评论(0) 推荐(0)

1.the sum (python)
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文

posted @ 2018-09-08 20:44 shaer 阅读(241) 评论(0) 推荐(0)

导航