题目:Sort a linked list inO(nlogn) time using constant space complexity.思路:nlogn的排序有快速排序、归并排序、堆排序。双向链表用快排比较适合,堆排序也可以用于链表,单向链表适合用归并排序。/** * Definition fo...
分类:
编程语言 时间:
2016-01-19 17:19:20
阅读次数:
180
using UnityEngine; using System.Collections; public class CoroutineTest : MonoBehaviour { void Start () { print("Starting " + Time.time); StartCorouti...
分类:
其他好文 时间:
2016-01-19 15:53:44
阅读次数:
292
题目链接:hysbz 2243 染色题目大意:略。解题思路:树链剖分+线段树的区间合并,可是区间合并比較简单,节点仅仅要记录左右端点的颜色就可以。#include #include #include using namespace std;const int maxn = 1e5 + 5;int N...
分类:
其他好文 时间:
2016-01-19 14:19:28
阅读次数:
179
#include #include #include #include #include using namespace std;int flag;char s[100000+10];int zero;char q[100000+10];bool Perfect(){ int len=strl...
分类:
其他好文 时间:
2016-01-19 13:57:23
阅读次数:
118
using (TransactionScope trans = new TransactionScope()) { try { db.Entry(entity); db.Set().Add(entity); ...
using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using NPOI.XSSF.UserModel;using System;using System.Collections.Generic;using System.Data;using Syst...
分类:
其他好文 时间:
2016-01-19 12:40:12
阅读次数:
159
1 using UnityEngine; 2 using UnityEditor; 3 using System; 4 5 public class AutoSave : EditorWindow { 6 7 private bool autoSaveScene = true; 8...
分类:
其他好文 时间:
2016-01-19 12:38:32
阅读次数:
140
新建一个.cs文件用来写生成图形验证码的方法,返回一个MemoryStream的参数。在Default.aspx中接收输出就可以了。1.下面是.cs的代码using System;using System.Collections.Generic;using System.Linq;using Sys...
分类:
其他好文 时间:
2016-01-19 12:37:07
阅读次数:
152
This interview question come from a famous communication firm of china. : ) 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 ...
分类:
其他好文 时间:
2016-01-19 12:19:53
阅读次数:
215
翻译给定一个整型数,写一个函数决定它是否是3的幂(翻译可能不太合适……跟进:
你是否可以不用任何循环或递归来完成。原文Given an integer, write a function to determine if it is a power of three.Follow up:
Could you do it without using any loop / recursion?分析题意我其...
分类:
其他好文 时间:
2016-01-19 10:41:30
阅读次数:
168