2017年12月22日

Integer 和int 比较

摘要: 在jdk1.5的环境下,有如下4条语句: 1 2 3 4 Integer i01 = 59; int i02 = 59; Integer i03 =Integer.valueOf(59); Integer i04 = new Integer(59)。 Integer i01=59 的时候,会调用 I 阅读全文

posted @ 2017-12-22 22:01 夜的第八章 阅读(207) 评论(0) 推荐(0) 编辑

add two numbers(将两个链表相加)

摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文

posted @ 2017-12-22 16:56 夜的第八章 阅读(173) 评论(0) 推荐(0) 编辑

majority element(数组中找出出现次数最多的元素)

摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文

posted @ 2017-12-22 14:45 夜的第八章 阅读(1309) 评论(0) 推荐(0) 编辑

intersection of two linked lists.(两个链表交叉的地方)

摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: 求两个链表开始重合的地 阅读全文

posted @ 2017-12-22 13:42 夜的第八章 阅读(136) 评论(0) 推荐(0) 编辑

min stack

摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文

posted @ 2017-12-22 10:51 夜的第八章 阅读(145) 评论(0) 推荐(0) 编辑

导航