Tuesday 12 January 2016

Error Type

Dynamic Programming

  • [N+1] for string
  • A.charAt(N) ERROR
  • Return not dp[N] or dp[N][M], but some MAX or MIN

LinkedList
  • Remove Node p (setting p.next = null)
  • break link (setting the left end's next = null)

Comparator
  • private Comparator<ListNode> listNodeComparator = new Comparator<ListNode>() {
  •         public int compare(ListNode left, ListNode right) {
  •             if (left == null) {
  •                 return 1;
  •             } else if (right == null) {
  •                 return -1
  •             }
  •             
  •             return left.val - right.val;
  •         }
  •     };

No comments:

Post a Comment