简历:The Google Resume: How to Prepare for a Career and Land a Job at Apple, Microsoft, Google, or any Top Tech Company
算法学习书籍:Introduction to Algorithms
编程珠玑:Programming Pearls (2nd Edition)
C++ 学习:The C++ Programming Language, 4th Edition
经典操作系统书籍,龙书:Operating System Concepts
创业:The Start-up of You: Adapt to the Future, Invest in Yourself, and Transform Your Career
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given
Given
Given
1->2->3->3->4->4->5
, return 1->2->5
.Given
1->1->1->2->3
, return 2->3
.
这道题做了好久逻辑还是没对,总是漏掉一些东西,考虑得很复杂,看了别人的代码后有了一些启发。第一,用safeguard,就是在head前面加上一个头结点,避免处理head的情况。最后记得删掉。第二,就是平时可以先用自己复杂的逻辑把代码写出来,再对比别人的看如何把逻辑简化,这样就可以把代码简化,多做几次会形成一种直觉,下一次设计会快很多。
No comments:
Post a Comment