std:: set intersection of application may [Notes]

2010-06-21  来源:本站原创  分类:CPP  人气:137 

1, such as telephone numbers of some more, if the file is quite big considering Instrumentation!
2, time overlapping operations.
3, changes in processing data.

#include "stdafx.h"
#include <set>
#include <string>
#include <algorithm>
#include <iostream>

using namespace std;

struct compare
{
        bool operator ()(string s1,string s2)
        {
           return s1 > s2;
        }/// Customize a functor
};
int main()
{
        typedef std::set<string,compare> _SET;
        _SET s;
        s.insert(string("sfdsfd"));
        s.insert(string("apple"));
        s.insert(string("english"));
        s.insert(string("dstd"));
        cout<<"s1:"<<endl;
        std::set<string,compare>::iterator it = s.begin();
        while(it!=s.end())
           cout<<*it++<<"   ";
        cout<<endl<<"s2:"<<endl;
        _SET s2;
        s2.insert(string("abc"));
        s2.insert(string("apple"));
        s2.insert(string("english"));
        it = s2.begin();
        while(it!=s2.end())
           cout<<*it++<<" ";
        cout<<endl<<endl;

        string str[10];
        string *end = set_intersection(s.begin(),s.end(),s2.begin(),s2.end(),str,compare());
        cout<<"result of set_intersection s1 <> s2:"<<endl;
        string *first = str;
        while(first<end)
    cout <<*first++<<" ";
        cout <<endl;
}
相关文章
  • std:: set intersection of application may [Notes] 2010-06-21

    1, such as telephone numbers of some more, if the file is quite big considering Instrumentation! 2, time overlapping operations. 3, changes in processing data. #include "stdafx.h" #include <set> #include <string> #include <algorit

  • Secret 4 Android Application Development Notes (Part 1) 2010-11-29

    Android Application Development Secret Chapter 4 Notes Android application interface controls typically use View and ViewGroup design styles with XML Events include button events, events, and some advanced touch screen space, event listener Android g

  • Secret 4 Android Application Development Notes (Part 2) 2010-12-02

    To take it for missing pages of the book, this interview a little stagnant for two days ... ... okay I'm lazy Before continuing introduction of controls on the Android Notes ● button (Button) Set setOnClickistener monitor, you can set the button size

  • JSF 2 Introduction, Part 1: streamlined Web application development 2010-09-11

    (Transfer from: http://www.ibm.com/developerworks/cn/java/j-jsf2fu1/ ) June 15, 2009 With the 2.0 release, Java ™ Server Faces (JSF) can now easily achieve robust, Ajax-style Web applications. This article is divided into three part series in the ope

  • FMS3 Series (1): The first FMS program, connect to the FMS server (Flash / Flex both implementations) 2010-07-19

    FMS is a very cattle X things, in the end a number of cattle X I do not want to say, interested friends can baidu an understanding that, if it is not hands-on, then you point the link below, my search for a point brief summary of information about. Y

  • FMS3 series (a): The first FMS program, connect to the FMS server (Flash / Flex both implementations) 2010-09-21

    FMS is a very cattle X thing, in the end a number of cattle X I do not want to say, interested friends can baidu a look, if you really do not want to get involved, then you point the link below, and I search for a point brief summary of the informati

  • FMS3 Series (1): The first FMS program, connected to the FMS server (Flash / Flex both implementations) 2010-09-21

    FMS is a very cattle X things, in the end a number of cattle X I do not want to say, interested friends can baidu an understanding that, if it is not hands-on, then you point the link below, my search for a point brief summary of information about. Y

  • FMS3 series (a): The first FMS program, connect to the FMS server (Flash / Flex implementation of two) [switch] 2010-12-25

    FMS is a very cattle X thing, in the end a number of cattle X I do not want to say, interested friends can baidu a look, if you really do not want to get involved, then you point the link below, and I search for a point brief summary of the informati

  • [Transfer] C + + Memory Pool 2011-01-10

    Original Address http://www.cppblog.com/d3d/archive/2008/11/28/68097.aspx SMemoryChunk.h #ifndef __SMEMORYCHUNK_H__ #define __SMEMORYCHUNK_H__ typedef unsigned char TByte ; struct SMemoryChunk { TByte *Data; // Data std::size_t DataSize; // The total

  • OFBiz Tutorials 2010-12-29

    OFBiz Tutorials These tutorials are designed to give you a basic knowledge of developing applications with OFBiz. Please read them in sequence. If you find any errors, please let us know. OFBiz in a Nutshell (PDF) - General overview of Open For Busin

  • HXSN邮件服务器升级技术方案书 2012-03-09

    第1章 邮件升级策略 本章覆盖了升级计划的制定及升级到Domino 8需要考虑的问题.Domino体系结构有很多种可能的变化,每一种变化需要考虑的因素可能都不一样.本章不涉及与某个具体设计相关的可能的因素,而主要集中在影响Domino体系结构的专题上,不依赖于规模的大小.硬件及使用的操作系统.本章包括以下专题: l 项目定义 l 资源计划 l 现有环境调查 l 制定计划 l 硬件和软件资源的考虑 l Domino R8的测试 l 重新规划Domino环境 l 本次项目的升级策略 1.1 项目定义

  • Boost.MapReduce 2012-05-14

    看着Boost.MapReduce是不是觉得跟Boost有关系?其实它只是以前放在Boost代码库的一个开源软件.它有几个不同与Google MapReduce和Hadoop的地方: 1. 它更Google使用的MapReduce一样是C++实现的,它核心使用模板实现. 2. 它是基于共享内存的MapReduce框架,可以运行在各种多核心处理器和共享内存处理器.它并不是基于网络的MapReduce框架,不能在多个机器上运行.可以作为一个多核心机器的数据处理框架.作者计划实现分布式的MapRedu

  • GNOME2 桌面系统中基于 MIME 类型的应用程序集成 - 少即是多 - 专注 2012-05-24

    http://www.ibm.com/developerworks/cn/linux/l-cn-gnome/#author1 赵 俊 ([email protected]), IBM中国软件开发中心,高级软件工程师 简介: 本文讨论了 GNOME2 桌面系统中基于 MIME 类型的应用程序集成的两种方法.在 GNOME2.8 前,GNOME2 使用自己的 MIME 定义方法来集成应用程序:从 2.8 开始,GNOME2 采用了 XDG(X Desktop Group) 提出的 MIME 数据库

  • Cython Application Notes 2010-04-21

    Cython Application Notes Author: gashero Date: 2010-03-29 Directory 1 Introduction 2 Basic use 3 call other C library 3.1 Simple example 3.2 to redefine the definition of an external C library 4 class definition Interaction with the Python 5 1 Introd

  • Database using the Notes application development tools Toad 2010-08-07

    TOAD using notes 1, the mouse stopped where the line in the sql, and then ctrl + Enter the direct implementation of the current sql. 2, to solve the problem Toad garbled on the Chinese display (if the database host where NLS_LANG is AMERICAN_AMERICA.

  • ubi and ubifs Application Notes [change] 2010-09-09

    ubi and ubifs Application Notes 1. Configuration ubi and ubifs in. config CONFIG_MTD_UBI = y CONFIG_UBIFS_FS = y CONFIG_CRYPTO_ALGAPI = y CONFIG_CRYPTO_DEFLATE = y CONFIG_CRYPTO_LZO = y CONFIG_CRC16 = y CONFIG_LZO_COMPRESS = y CONFIG_LZO_DECOMPRESS =

  • Android Application Development Secret Chapter Notes 1,2 2010-11-27

    Android finally opened the book, just look at the first two chapters, some general introduction to the structures and the environment. Simple things like the outline notes it as a record, from tomorrow, should be considered a formal learning Android.

  • JBoss ESB study notes 2 - Hello World application of the first ESB 2010-12-13

    Continued after the above build a good development environment to develop ESB applied. This article describes the first ESB application - Hello, World. Note: This article and subsequent articles, though not a hundred percent original, but after all m

  • beast study notes - 6, application.html.erb 2010-12-22

    beast study notes - 6, application.html.erb 1 / The overall layout of this template: <div> </ div> <div> <div> </ div> <div> </ div> </ Div> <div> </ div> 2 (1) code <% = Render: partial =>

  • ocp research brief notes and application process 2011-06-27

    Transfer: http://warehouse.itpub.net/post/777/508520 Of ocp interested can contact Xie Yongsheng, screen name warehouse, a former well-known oracle Forum www.itpub.net new technology area owner, current owner oracle certification area blog address: h