此题关键是要发现周期性。#include #include int f[1000];int compute(int a, int b, int n){ int i, cycle; memset(f, 0, 1000*sizeof(int)); f[1] = 1; f[...
分类:
其他好文 时间:
2015-03-13 20:29:01
阅读次数:
138
Given a linked list, determine if it has a cycle in it.简单题,只要知道快慢指针这个技巧就很容易解了。 1 class Solution { 2 public: 3 bool hasCycle(ListNode *head) { 4 ...
分类:
其他好文 时间:
2015-03-13 01:38:17
阅读次数:
110
Linked List Cycle ii Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it ...
分类:
其他好文 时间:
2015-03-12 00:39:43
阅读次数:
157
Linked List CycleGiven a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space?SOLUTION 1: 依次将链表节点添加入已....
分类:
其他好文 时间:
2015-03-11 23:04:31
阅读次数:
223
继续水题#include int i,x,y,a,b,temp;int cycel(int i);int cycle(int i){ int j = 1; while( i != 1) { if(i%2) i = 3*i+1; el...
分类:
其他好文 时间:
2015-03-10 10:07:37
阅读次数:
140
微软近期Open的职位:Job Title: Senior Software EngineerWork Location: Suzhou/Beijing, ChinaDo you want to work on a fast-cycle, high visibility, hardcore sear...
分类:
其他好文 时间:
2015-03-09 12:16:29
阅读次数:
110
微软近期Open的职位:Job Title: Software Engineer IIWork Location: Suzhou/Beijing, ChinaDo you want to work on a fast-cycle, high visibility, hardcore search t...
分类:
其他好文 时间:
2015-03-09 00:17:03
阅读次数:
161
Linked List Cycle II问题:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it withou...
分类:
其他好文 时间:
2015-03-08 21:21:21
阅读次数:
159
微软近期Open的职位:Job Title: Software Engineer IILocation: Suzhou, ChinaWant to work on a fast-cycle, high visibility, hardcore search team with ambitious g...
分类:
其他好文 时间:
2015-03-08 11:33:14
阅读次数:
149
??
一、msSQL errorlog 引起磁盘空间不足的方法
执行一次EXEC sp_cycle_errorlog就会产生一个新的errorlog去覆盖旧errorlog。只要循环7次就可以把errorlog都覆盖一遍。
二、简单压缩日志及数据库文件的方法
1.右建数据库属性窗口--故障还原模型--设为简单;
2.右建数据库所有任务--收缩数据库;
3.右建数据库属...
分类:
数据库 时间:
2015-03-06 22:17:03
阅读次数:
261