第七章 F# 库(三)
序列(Microsoft.FSharp.Collections.Seq)模块
 
Microsoft.FSharp.Collections.Seq 模块包含所有处理集合的模块,只要它支持 IEnumerable 接口, .NET 框架的 BCL 中的大多数集合都是的。这个模块之所以称为序列(Seq),是因为序列是IEnumerable 接口的别名,是对其简...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 23:02:32   
                                阅读次数:
208
                             
                         
                    
                        
                            
                            
                                一个轮流取数的游戏,取得的值最大者胜,这里要求结果。
这里使用一下deque数据结构吧。当然这里使用一般数列,用two points的思想解决也是可以的。
deque是可以两头取数都很快的容器。很适合本题这样的情况...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 23:00:16   
                                阅读次数:
286
                             
                         
                    
                        
                            
                            
                                using System;using System.Collections.Generic;using 
System.IO;using System.Linq;using System.Text;using 
System.Threading.Tasks;namespace 读文件案例{ cla...
                            
                            
                                分类:
其他好文   时间:
2014-07-22 22:59:55   
                                阅读次数:
241
                             
                         
                    
                        
                            
                            
                                从文本文件添加到数据库用户表的记录(有两个文件:frmMain.cs SqlHelper.cs 
)//FrmMain.cs//作者:Meusing System;using System.Collections.Generic;using 
System.ComponentModel;using Sy...
                            
                            
                                分类:
数据库   时间:
2014-05-01 22:45:21   
                                阅读次数:
667
                             
                         
                    
                        
                            
                            
                                C#冒泡排序,转载自:http://bbs.it-home.org/forum-net-2.html不多解析自己看去吧using 
System;using System.Collections.Generic;using System.Linq;using 
System.Text;namespace...
                            
                            
                                分类:
其他好文   时间:
2014-05-01 20:17:35   
                                阅读次数:
348
                             
                         
                    
                        
                            
                            
                                c++中,Deque容器和vector相似,deque内部也采用动态数组来管理元素,支持随机存取。。头文件1.deque和vector的不同之处:1)两端都可以较快速地按插元素和删除元素,而vector只能在尾端进行2)在对内存有所限制的系统中,deque可以包含更多的元素,因为它不止一块内存。因此...
                            
                            
                                分类:
编程语言   时间:
2014-05-01 10:10:02   
                                阅读次数:
500
                             
                         
                    
                        
                            
                            
                                今天写的特别简单的代码,大体是一个模式选择,从控制台读入一个数,然后做出相应的选择. 
代码如下:using System;using System.Collections.Generic;using System.Linq;using 
System.Text;using System.Thre...
                            
                            
                                分类:
其他好文   时间:
2014-05-01 08:41:35   
                                阅读次数:
340
                             
                         
                    
                        
                            
                            
                                链接:http://acm.hdu.edu.cn/showproblem.php?pid=3415
题意:给出一个数环,要找出其中9长度小于等于K的和最大的子段。
思路:不能采用最暴力的枚举,题目的数据量是10^5,O(N^2)的枚举回去超时,本题采用的很巧妙的DP做法,是用单调队列优化的DP。
运用的是STL的deque,从i:1~a找到以其中以i为尾的符合条件的子段,并将i本身放入双向队...
                            
                            
                                分类:
其他好文   时间:
2014-05-01 08:32:53   
                                阅读次数:
324
                             
                         
                    
                        
                            
                            
                                关于最大熵模型的介绍请看:http://www.cnblogs.com/hexinuaa/p/3353479.html
下面是GIS训练算法的python实现,代码不到100行。
from collections import defaultdict
import math
class MaxEnt(object):
    def __ini...
                            
                            
                                分类:
其他好文   时间:
2014-04-30 22:46:39   
                                阅读次数:
384
                             
                         
                    
                        
                            
                            
                                using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinqToEntity
{
    class Program
    {
        static void Main(string[] args)
        {
            //...
                            
                            
                                分类:
其他好文   时间:
2014-04-29 13:16:21   
                                阅读次数:
574