2021-2022-1 20211427 《信息安全專業(yè)導(dǎo)論》第七周學(xué)習(xí)總結(jié)
作業(yè)信息
2020-2021-1信息安全專業(yè)導(dǎo)論|
2020-2021-1信息安全專業(yè)導(dǎo)論第七周作業(yè)
[學(xué)習(xí)目標(biāo)] |數(shù)組與鏈表
基于數(shù)組和基于鏈表實(shí)現(xiàn)數(shù)據(jù)結(jié)構(gòu)
無(wú)序表與有序表
樹(shù)
圖
子程序與參數(shù)|
作業(yè)正文
教材學(xué)習(xí)內(nèi)容總結(jié)
數(shù)組是同構(gòu)項(xiàng)目的有名集合,可以通過(guò)單個(gè)項(xiàng)目在集合中的位置訪問(wèn)它們。
列表可以被形象化為鏈?zhǔn)浇Y(jié)構(gòu)。列表的三個(gè)屬性特征:項(xiàng)目是同構(gòu)的,項(xiàng)目是線性的,列表是變長(zhǎng)的。
鏈?zhǔn)浇Y(jié)構(gòu):一個(gè)將數(shù)據(jù)項(xiàng)和找到下一項(xiàng)位置的信息保存到同一容器的實(shí)現(xiàn)方法。
數(shù)組是內(nèi)嵌結(jié)構(gòu),列表是抽象結(jié)構(gòu)。列表應(yīng)用于數(shù)組中。
數(shù)據(jù)結(jié)構(gòu):一種抽象數(shù)據(jù)類型中的復(fù)合數(shù)據(jù)域的實(shí)現(xiàn)。
樹(shù)的分層體系結(jié)構(gòu)為高層分類,隨著向下移動(dòng),標(biāo)簽會(huì)變得更加具體,每一個(gè)節(jié)點(diǎn)下方都可能會(huì)有許多的節(jié)點(diǎn)。
圖:由一組節(jié)點(diǎn)和一組把節(jié)點(diǎn)相互連接起來(lái)的邊構(gòu)成的數(shù)據(jù)結(jié)構(gòu)。
頂點(diǎn):圖中的節(jié)點(diǎn)。
邊(弧):表示圖中兩個(gè)節(jié)點(diǎn)的連接的頂點(diǎn)對(duì)。
教材學(xué)習(xí)中的問(wèn)題和解決過(guò)程
問(wèn)題1:樹(shù)與圖的區(qū)別與聯(lián)系
解決過(guò)程:樹(shù)中一個(gè)節(jié)點(diǎn)至多只有一個(gè)指向它的節(jié)點(diǎn),圖沒(méi)有這種約束。二者都是表示存在層次結(jié)構(gòu)關(guān)系的數(shù)據(jù)結(jié)構(gòu)。
代碼調(diào)試中的問(wèn)題和解決過(guò)程
問(wèn)題1:輸入的值是不同的類型時(shí)進(jìn)行計(jì)算時(shí)會(huì)出錯(cuò)。
解決過(guò)程:使用int()將數(shù)據(jù)類型轉(zhuǎn)換為整數(shù)。
問(wèn)題2:計(jì)算類型的代碼運(yùn)行后無(wú)法輸出值,也不停止運(yùn)行。
解決過(guò)程:檢查如果Python的代碼縮進(jìn)錯(cuò)誤可能會(huì)出現(xiàn)這種情況。
[代碼托管]
`# coding=utf-8
代碼文件: ch08/ch8_6_1.py
定義加法函數(shù)
def add(a, b):
return a + b
定義減法函數(shù)
def sub(a, b):
return a - b
定義計(jì)算函數(shù)
def calc(opr):
if opr == '+':
return add
else:
return sub
f1 = calc('+') # f1實(shí)際上是add()函數(shù)
f2 = calc('-') # f2實(shí)際上是sub()函數(shù)、
print("10 + 5 = {0}".format(f1(10, 5)))
print("10 - 5 = {0}".format(f2(10, 5)))`
coding=utf-8
代碼文件: ch08/ch8_6_2.py
提供過(guò)濾條件函數(shù)
def f1(x):
return x > 50 # 找出大于50元素
datal = [66, 15, 91, 28, 98, 50, 7, 80, 99]
filtered = filter(f1, datal)
data2 = list(filtered) # 轉(zhuǎn)換為列表
print(data2)
coding=utf-8
代碼文件: ch08/ch8_6_3.py
提供變換規(guī)則的函數(shù)
def f1(x):
return x * 2 # 變換規(guī)則乘以2
data1 = [66, 15, 91, 28, 98, 50, 7, 80, 99]
mapped = map(f1, data1)
data2 = list(mapped ) # 轉(zhuǎn)換為列表
print(data2)
上周考試錯(cuò)題總結(jié)
Which language is actually executed by the central processing unit of a computer?
A.High-level language
B.Assembly language
C.Machine language
D.Virtual language
E.Accumulator language
正確答案:C
簡(jiǎn)單計(jì)算機(jī)的中央處理器執(zhí)行的是機(jī)器語(yǔ)言。
Which of the following is true about black-box testing?
A. The test cases are based on the code.
B. The test cases are based on the input.
C. The test cases are based on the output.
D. The testing is performed by dedicated testers.
E. The testing is performed each time the program changes.
正確答案:B
黑箱測(cè)試中的測(cè)試用例基于輸出。
學(xué)習(xí)進(jìn)度條
| 代碼行數(shù)(新增/累積) | 博客量(新增/累積) | 學(xué)習(xí)時(shí)間(新增/累積) | 重要成長(zhǎng) | |
|---|---|---|---|---|
| 目標(biāo) | 5000行 | 30篇 | 400小時(shí) | |
| 第一周 | 50/50 | 1/1 | 8/8 | |
| 第二周 | 60/110 | 3/4 | 9/17 | |
| 第三周 | 80/190 | 1/5 | 8/25 | |
| 第四周 | 160/350 | 1/6 | 9/34 | |
| 第五周 | 450/800 | 1/7 | 13/47 | |
| 第六周 | 700/1500 | 1/8 | 16/63 | |
| 第七周 | 700/2200 | 3/11 | 16/79 |
-
計(jì)劃學(xué)習(xí)時(shí)間:15小時(shí)
-
實(shí)際學(xué)習(xí)時(shí)間:16小時(shí)
浙公網(wǎng)安備 33010602011771號(hào)