上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 49 下一页

2015年4月2日

从1到1000中随机取出900个不重复的随机数

摘要: 思路用大小为1000的数组保存1-1000的整数,int nums[1000] = {1,2,3,...1000}。使用Random.nextInt()获取[0,999]下标值,即index = Random.nextInt(1000),交换坐标为0和index的值在使用Random.nextInt... 阅读全文

posted @ 2015-04-02 23:29 luckygxf 阅读(1069) 评论(0) 推荐(0)

取苹果方式总数

摘要: 50个苹果,一次取一个或者两个,直到取完为止,一共有多少种取法这是一个斐波拉契数列,可以用动态规划来实现 1 public class Test { 2 public static void main(String[] args) { 3 long count[] = new... 阅读全文

posted @ 2015-04-02 09:23 luckygxf 阅读(184) 评论(0) 推荐(0)

2015年3月27日

Net-SNMP(V3协议)安装配置笔记(CentOS 5.2)(转)

摘要: 原出处:http://blog.ihipop.info/2010/03/722.html为了这颗仙人掌(cacti),我必须先部署(Net-SNMP),同时我为了安全因素,也为了简便考虑,决定采用采用Net-SNMP(V3协议)来部署,可是国内中文环境下面部署V3协议的是在是太少哦(找来找去都是一些... 阅读全文

posted @ 2015-03-27 10:06 luckygxf 阅读(1043) 评论(0) 推荐(0)

2015年3月16日

单例模式

摘要: 面试官:设计模式熟悉吗?屌丝:知道一点点...面试官:哪个设计模式你比较熟悉?屌丝:单例模式听说过..面试官:那请你把单例模式写一下吧屌丝:好...没有准备,所以没有写出来 1 public class Singleton { 2 private static Singleton singl... 阅读全文

posted @ 2015-03-16 09:13 luckygxf 阅读(151) 评论(0) 推荐(0)

面试中遇到一道大数相加算法题

摘要: 题目大意给一个数字123,放到数组中1 2 3,对数字进行加1,变成124思路求出数字长度,数字放到数组中,对数组第一个元素加1,对数组进行进位处理 1 import java.util.Scanner; 2 3 public class BigNumAdd { 4 public void... 阅读全文

posted @ 2015-03-16 09:00 luckygxf 阅读(624) 评论(1) 推荐(0)

2015年3月11日

Department Highest Salary

摘要: TheEmployeetable holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+----... 阅读全文

posted @ 2015-03-11 09:53 luckygxf 阅读(350) 评论(0) 推荐(0)

2015年3月10日

Number of 1 Bits

摘要: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in... 阅读全文

posted @ 2015-03-10 17:11 luckygxf 阅读(194) 评论(0) 推荐(0)

Combine Two Tables

摘要: Table:Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName ... 阅读全文

posted @ 2015-03-10 15:29 luckygxf 阅读(208) 评论(0) 推荐(0)

Second Highest Salary

摘要: Write a SQL query to get the second highest salary from theEmployeetable.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || ... 阅读全文

posted @ 2015-03-10 15:01 luckygxf 阅读(160) 评论(0) 推荐(0)

Employees Earning More Than Their Managers

摘要: TheEmployeetable holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+-------+-... 阅读全文

posted @ 2015-03-10 14:30 luckygxf 阅读(264) 评论(0) 推荐(0)

上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 49 下一页

导航