Divide two integers without using multiplication, division and mod operator.分析:题目意思很容易理解,就是不用乘除法和模运算求来做除法,很容易想到的一个方法是一直做减法,然后计数,超时。在网上找到一种解法,利用位运算,意思是...
分类:
其他好文 时间:
2014-10-21 02:10:36
阅读次数:
185
var timer=null;var aNow=null;var g_aImg=[];var g_oImgWeek=null;var g_aWeekName=[ "one", "two", "three", "four", "five", "six", "seven"];window.onload=...
分类:
其他好文 时间:
2014-10-21 00:47:58
阅读次数:
222
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.
/**
* Definition for singly-linked list.
* publ...
分类:
其他好文 时间:
2014-10-20 21:28:05
阅读次数:
233
Divide two integers without using multiplication, division and mod operator.分析:不能用乘、除、取模运算,我们可以用的运算还有加、减、位运算。一个比较简单的想法是在dividend上不断减去divisor,知道余数小于div...
分类:
其他好文 时间:
2014-10-20 21:18:28
阅读次数:
183
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
分类:
其他好文 时间:
2014-10-20 18:50:54
阅读次数:
111
Description
Jenny is a warehouse keeper. He writes down the entry records everyday. The record is shown on a screen, as follow:
There are only two buttons on the screen. Pressing the button i...
分类:
其他好文 时间:
2014-10-20 15:06:03
阅读次数:
259
其实只要修改用户 .vnc目录下的xstartup配置文件即可[root@localhost ~]# more /root/.vnc/xstartup#!/bin/sh# Uncomment the following two lines for normal desktop:# unset SES...
分类:
其他好文 时间:
2014-10-20 14:55:43
阅读次数:
246
Problem:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Yo...
分类:
其他好文 时间:
2014-10-20 13:15:42
阅读次数:
195
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your alg...
分类:
其他好文 时间:
2014-10-20 09:49:08
阅读次数:
181
Power Strings
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 33178
Accepted: 13792
Description
Given two strings a and b we define a*b to be their concatena...
分类:
其他好文 时间:
2014-10-19 21:29:13
阅读次数:
204