首页 > 其他分享 >Programming abstractions in C阅读笔记:p179-p180

Programming abstractions in C阅读笔记:p179-p180

时间:2023-10-16 09:55:20浏览次数:39  
标签:function p179 predicate p180 abstractions 示例 Programming same

《Programming Abstractions In C》学习第60天,p179-p180总结。

一、技术总结

1.palindrome(回文)

(1)包含单个字符的字符串(如"a"),或者空字符串(如" ")也是回文。

(2)示例:“level”、"noon"。

2.predicate function

(1)predicate的意思

pre-("forth") + *deik-("show"),“that which is said of subject(关于某个东西的论述)”。也有“vt. to say sth that is true(断言)”之意。

(2) predicate function

Predicate function is function that returen True or False。

(3)示例

// predicate function示例: IsPalindrome()就是一个predicate function
bool IsPalindrome(string str) {
    int len;

    len = StringLength(str);
    if (len <= 1) {
        return TRUE;
    } else {
        return (IthChar(str, 0) == IthChar(str, len - 1)
                && IsPalindrome(SubString(str, 1, len - 2)));
    }

}

二、英语总结

1.palindrome是什么意思?

答:palin("back") + drome("a running")。c. a word that reads the same forward and backward(回文)。

2.dentically是什么意思?

答:

(1)identically < identical: adv. in a way that is excatly the way。

(2)identical < identity: adj. exactly the same(完全相同)。

(3)identity: idem-("the same"), used to avoid repetition in writing。u. the fact of being or feeling the same。

(4)identify: regard as the same(识别)。vt. to recognize sth and prove what that thing is。

3.revised是什么意思?

答:

p180,The revised implementation of Palindrome appears in Figure4-4。

(1)revised < revise: adj. changed in someway(经过修改的)。

(2)revise: re-("repitition") + videre("to see"),即“to look at again”,后面逐渐引申为“to look over again with intent to to improve or amend(为了改进或修正而重新审视)”。look over: to quickly examine。

三、参考资料

1. 编程

(1)Eric S.Roberts,《Programming Abstractions in C》:https://book.douban.com/subject/2003414

2. 英语

(1)Etymology Dictionary:https://www.etymonline.com

(2) Cambridage Dictionary:https://dictionary.cambridge.org

欢迎搜索及关注:编程人(a_codists)

标签:function,p179,predicate,p180,abstractions,示例,Programming,same
From: https://www.cnblogs.com/codists/p/17766728.html

相关文章

  • Programming abstractions in C阅读笔记:p176-p178
    《ProgrammingAbstractionsInC》学习第59天,p176-p178总结。一、技术总结1.addtivesequencestn=tn-1+tn-2序列:3,7,10,17,27,44,71,115,186,301,487,788,1275,...p177,Asageneralclass,thesequencesthatfollowthispatternarecalledadditivesequen......
  • Programming abstractions in C阅读笔记:p176-p178
    《ProgrammingAbstractionsInC》学习第59天,p176-p178总结。一、技术总结1.addtivesequencestn=tn-1+tn-2序列:3,7,10,17,27,44,71,115,186,301,487,788,1275,...p177,Asageneralclass,thesequencesthatfollowthispatternarecalledadditive......
  • Programming abstractions in C阅读笔记:p166-p175
    《ProgrammingAbstractionsInC》学习第58天,p166-p175总结。一、技术总结1.斐波那契数列(FibonacciSequenc)(1)斐波那契数列来源斐波那契数列来自于《LiberAbaci》一书里兔子繁殖问题,相关资料很多,这里不赘述。(2)关于《LiberAbaci》一书《LiberAbaci》——Liber:abook......
  • Programming abstractions in C阅读笔记:p132-p137
    《ProgrammingAbstractionsInC》学习第53天,p132-p137,3.2小节“strings”总结如下:一、技术总结3.2小节介绍了字符串的用法:1.C语言是没有字符串(string)这种数据类型的,但是实际的场景中又很需要这种数据类型,那怎么表示字符串呢?有两种方法:1.用字符数组表示。2.用字符指针表示。......
  • Programming abstractions in C阅读笔记:p130-p131
    《ProgrammingAbstractionsInC》学习第52天,p130-p131,总结如下:一、技术总结1.piglatingame通过piglatingame掌握字符复制,指针遍历等操作。/**输入:字符串,这里采用书中坐着自定义的getline函数*/#include<stdio.h>#include<string.h>#include"simpio.h"#def......
  • Programming abstractions in C阅读笔记:p127-p129
    《ProgrammingAbstractionsInC》学习第51天,p127-p129,总结如下:一、技术总结1.stringlibrary掌握常用函数如strlen,strcpy用法。2.bufferoverflow(缓冲区溢出)(1)什么是buffer?p129,Arraysthatarepreallocatedandlateruseasarepositoryfordatacalledbuffers......
  • Programming abstractions in C阅读笔记:p123-p126
    《ProgrammingAbstractionsInC》学习第50天,p123-p126,总结如下:一、技术总结1.notaion这也是一个在计算机相关书籍中出现的词,但有时却不是那么好理解,因为它可以指代很多对象,这里做一个记录。示例:p124。InC,youcanuseanycharacterarraytoholdstringdata.charstr[6]={......
  • Programming abstractions in C阅读笔记: p118-p122
    《ProgrammingAbstractionsInC》学习第49天,p118-p122,总结如下:一、技术总结1.随机数(1)seedp119,"Theinitialvalue--thevaluethatisusedtogettheentireprocessstart--iscallaseedfortherandomgenerator."二、数学总结1.均匀分布(uniformdistribution)......
  • Programming abstractions in C阅读笔记: p114-p117
    《ProgrammingAbstractionsinC》学习第48天,p114-p117,​总结如下:一、技术总结主要通过randomnumber介绍了随机数的相关用法,interface​示例(random.h)​,clientprogram示例(craps.c)。#include<stdio.h>#include"genlib.h"#include"random.h"staticboolTryToMakePo......
  • Programming abstractions in C阅读笔记p111-p113: boilerplate
    《ProgrammingAbstractionsInC》学习第47天,p111-p113,总结如下:一、技术总结1.boilerplate/**File:random.h*Version:1.0*LastmodifiedonFriJul2216:44:361994byeroberts*-----------------------------------------------------*Thisinterfacepr......