Leeroy Leeroy
关注数: 0 粉丝数: 39 发帖数: 4,699 关注贴吧数: 3
中英文术语不完全对照(摘自Effective C++第三版,侯捷译) abstract 抽象的abstraction 抽象性access 访问access level 访问级别adapter 适配器address 地址address-of operator 取地址操作符aggregation 聚合algorithm 算法allocate 分配allocator 分配器application 应用程序architecture 体系结构argument 实参array 数组arrow operator 箭头操作符assembly language 汇编语言assert(-ion) 断言assign(-ment) 赋值assignment operator 赋值操作符base class 基类base type 基类型binary search 二分查找binary tree 二叉树binary operator 二元操作符binding 绑定bit 位bitwise 以位为单位逐一OOXX(OOXX中填上对应的动作)block 区块boolean 布尔值breakpoint 断点build 建置build-in 内置bus 总线byte 字节cache 高速缓存call 调用callback 回调call operator  call操作符(这是啥)character 字符child class 子类class 类class template 类模板client 客户code 代码compatible 兼容compile time 编译期compiler 编译器component 组件composition 复合concrete 具象的concurrent 并发configuration 配置connection 连接constraint 约束(条件)construct 构件container 容器(这个能算术语么)const C/C++关键字,constant)constant 常量constructor 构造函数copy(v.) 拷贝(虽然我更习惯叫复制)copy(n.) 复件、副本create 创建custom 定制data 数据database 数据库data member 成员变量data structure 数据结构debug 调试debugger 调试器declaration 声明式default 缺省definition 定义式delegate 委托dereference 提领(解参考)(其实我更愿意叫做解引用)derived class 派生类design pattern 设计模式destroy 销毁(这个也叫术语?)destructor 析构函数directive 指示符document 文档dynamic binding 动态绑定entity 物体encapsulation 封装enum(-eration) 枚举equality 相等equivalence 等价evalute 核定、核算exception 异常explicit 显式expression 表达式file 文件framework 框架full specialization 全特化function 函数function object 函数对象function template 函数模板generic 泛型、泛化、一般化getter(相对于setter) 取值函数global 全局的handle 句柄handler 处理函数hash table 哈希表、散列表hader(file) 头文件heap 堆hierarchy 继承体系(层次结构)identifier 标识符implement(-ion) 实现implicit 隐喻的、暗自的、隐式information 信息inheritance 继承inline 内联initialization list 初值列initialization 初始化instance 实体instantiate 具体化、实现化interface 接口Internet (这条我拒绝提供解释)interpreter 解释器invariants 恒常性invoke 调用iterator 迭代器library 程序库linker 连接器literal 字面常量list 链表load 装载local 局部的lock 机锁loop 循环lvalue 左值macro 宏member 成员member function 成员函数memory 内存memory leak 内存泄漏meta- 元-meta-programming 元编程modeling 塑模module 模块modifier 修饰符multi-tasking 多任务namespace 命名空间native 固有的nested 嵌套object 对象object based 基于对象的object model 对象模型object oriented 面向对象operand 操作数operating system 操作系统operator 操作符overflow 溢出overhead 额外开销overload 重载override 覆写package 包parallel 并行parameter 参数、形参parent class 父类parse 解析partial specialization 偏特化pass by reverence 按址传递(C中也作pass by pointer)pass by value 按值传递pattern 模式placement delete (某种特殊形式的delete operator)placement new (某种特殊形式的new operator)pointer 指针polymorphism 多态preprocessor 预处理器print 打印printer 打印机process 进程program 程序programmer 程序员programming 编程project 项目pseudo code 伪码quality 质量queue 队列raw 原始的、未经处理的recursive 递归refer to 指涉、指称、指向reverence 引用regular expression 正则表达式resolve 解析return 返回return type 返回类型return value 返回值runtime 运行期rvalue 右值save 存储schedule 调度scheduler 调度器scope 作用域search 查找semantics 语义setter(相对于getter) 设值函数signature 签名(式)smart pointer 智能指针specialization 特化source 源码stack 栈standard library 标准程序库statement 语句static 静态的string 字符串subtype 子类型support 支持template 模板temporary object 临时对象text 文本thread 线程thread safe 多线程安全throw 抛、掷token 语汇单元(这又是啥)type 类型unary function 单参函数underflow 下溢unqualified 未经资格修饰(???)user 用户user interface 用户界面value 值、数值variable 变量vector 矢量virtual function 虚函数virtual machine 虚拟机
How Important Are Algorithms? 题目是我加的You might wonder whether algorithms are truly that important on contemporary computers in light of other advanced technologies, such as. hardware with high clock rates, pipelining, and superscalar architectures,. easy-to-use, intuitive GUIs,. object-oriented systems, and. local-area and wide-area networking.The answer is yes. Although there are some applications that do not explicitly require algorithmic content at the application level (e.g., some simple web-based applications), most also require a degree of algorithmic content on their own. For example, consider a web-based service that determines how to travel from one location to another. (Several such services existed at the time of this writing.) Its implementation would rely on fast hardware, a GUI, wide-area networking, and also possibly on object orientation. However, it would also require algorithms for certain operations, such as finding routes (probably using a shortest-path algorithm), rendering maps, and interpolating addresses.Moreover, even an application that does not require algorithmic content at the application level relies heavily upon algorithms. Does the application rely on fast hardware? The hardware design used algorithms. Does the application rely on GUIs? The design of any GUI relies on algorithms. Does the application rely on networking? Routing in networks relies heavily on algorithms. Was the application written in a language other than machine code? Then it was processed by a compiler, interpreter, or assembler, all of which make extensive use of algorithms. Algorithms are at the core of most technologies used in contemporary computers.
C++学习中的一些忠告 Here is a set of "rules" you might consider while learning C++. As you get more proficient you can evolve them into something suitable for your kind of applications and your style of programming. They are deliberately very simple, so they lack detail. Don't take them too literally. To write a good program takes intelligence, taste, and patience. You are not going to get it right the first time. Experiment!这里是一组在你学习C++的过程中或许应该考虑的“规则”。随着你变得更加熟练,你将能把它转化为某种更适合你的那类应用系统或者你自己的程序设计的东西。它们有意被写得很简单,因此都缺乏细节。请不要太拘泥于他们的字面意义。要写出一个好程序需要智慧、品味和耐性。你不会第一次就能把它搞好的。试验![1]When you program, you create a concrete representation of the ideas in your solution to some problem. Let the structure of the program reflect those ideas as directly as possible.在编程序时,你是在为你针对某个问题的解决方案中的思想建立起一种具体表示。让程序的结构尽可能地直接反映这些思想。    [a]If you can think of “it” as a separate idea, make it a class.如果你能把“它”看成一个独立的概念,就把它做成一个类。    [b]If you can think of “it” as a separate entity, make it an object of some class.如果你能把“它”看成一个独立的实体,就把它做成某个类的一个对象。    [c]If two classes have a common interface, make that interface an abstract class.如果两个类有共同的接口,将这些接口做成一个抽象类。    [d]If the implementations of two classes have something significant in common, make that commonality a base class.如果两个类的实现有某些显著的共同东西,将这些共性做成一个基类。    [e]If a class is a container of objects, make it a template.如果一个类是一种对象的容器,将它做成一个模板。    [f]If a function implements an algorithm for a container, make it a template function implementing the algorithm for a family of containers.如果一个函数实现对某容器的一个算法,将它做成对一族容器可用的模板函数。    [g]If a set of classes, templates, etc., are logically related, place them in a common namespace.如果一组类、模板等相互之间有逻辑联系,将它们放进一个名字空间里。[2]When you define either a class that does not implement a mathematical entity like a matrix or a complex number or a low-level type such as a linked list:当你定义一个并不是实现像某个矩阵或复数这样的数学对象的类时,或者定义一个低层的类型如链表的时候:    [a]Don’t use global data (use members).不要使用全局数据(使用成员)。    [b]Don’t use global functions.不要使用全局函数。    [c]Don’t use public data members.不要使用公有数据成员。    [d]Don’t use friends, except to avoid [a] or [c].不要使用友元,除非是为了避免[a]或[c]。    [e]Don’t put a “type field” in a class; use virtual functions.不要在一个类里面放“类型域”①;采用虚函数。    [f]Don’t use inline functions, except as a significant optimization.不要使用内联函数,除非对效率有显著的优化。①指那种为了说明一个类所存储数据的情况而放置的标志域
[无聊]一些让大家玩的题目 【级数求和】问题描述:已知:Sn=1+1/2+1/3+….+1/n。显然,当n非常大的时候,Sn可大于任何一个整数K。现给出一个整数K(1≤K≤15),要求计算出一个最小的n,使得Sn>K。输入: k输出: n测试数据:输入:1输出:2 输入:3输出:11输入:7输出:616输入:14输出:675214输入:10输出:12367输入:12输出:91380【编码问题】问题描述:设有一个数组A:ARRAY[0..N-1] OF INTEGER;数组中存储的元素为0-N-1之间的整数,且A[I]≠A[J] (当I≠J)时。例如:N=6时,有:(4,3,0,5,1,2)。此时,数组A的编码定义如下:  A[0]的编码为0;  A[I]的编码为:在A[0],A[1],……A[I-1]中比A[I]的值小的元素的个数(I=1,2,……N-1) 所以上面数组A的编码为:B=(0,0,0,3,1,2)程序要求:  ①给出数组A后,求出其编码;  ②给出数组A的编码后,求出A的原数据【构造子串】问题描述:生成长度为n的字串,其字符从26个英文字母的前p(p≤26)个字母中选取,使得没有相邻的子序列相等。例如p=3,n=5时:  abcba 满足条件   abcbc 不满足条件输入:n p输出:所有满足条件的字串及总数测试数据:输入:1 1输出:a1 输入:1 2输出:ab2 输入:3 2输出:ababab2 输入:3 5输出:abaabc...edcede80 输入:5 4输出:abacaabacbabacdabadaabadbabadcabcababcac...dcdaddcdbadcdbcdcdbd264 输入:7 10输出: ... 【字符近似查找】问题描述:设有n个单词的字典表(1<=n<=100)。计算某单词在字典表中的4种匹配情况(字典表中的单词和待匹配单词的长度上限为255):  i: 该单词在字典表中的序号;  Ei:在字典表中仅有一个字符不匹配的单词序号;  Fi:在字典表中多或少一个字符(其余字符匹配)的单词序号;  N:其他情况;  当查找时有多个单词符合条件,仅要求第一个单词的序号即可。 输入:  n   字典表的单词数 n行  每行一个单词  待匹配单词 输出:  i  Ei  Fi  其中i为字典表中符合条件的单词序号(1<=i<=n),若字典表不存在符合条件的单词,则对应的i=0。若上述3种情况不存在,则输出N。 测试数据:输入:  5  abcde  abc  asdfasfd  abcd  aacd  abcd 输出:  4  E5  F1输入:  1 a b输出:  0 E0 F0 N输入: 10 ljlkj kljalkfja abook bbookklj ajflaj difaja;lfj book boak jajflkja jdskajfla book输出: 7 E8 F3输入: 8 vczvczvczvczvcz kljalkfja vczvczvvczvczvczvczvczvczx bbookklj dislkkk sfcvzvcxv afdaaaaaaaaaaaafdfdfdfd disklll disk输出: 0 E0 F0 N【选数】问题描述:已知n个整数 x1,x2,…,xn,以及一个整数k (k
1 下一页