阿摩線上測驗 登入

申論題資訊

試卷:113年 - 113 國立嘉科實驗高級中學_國中部教師甄選試題:資訊科#119115
科目:教甄◆資訊科技概論專業(電腦科)
年份:113年
排序:0

申論題內容

2 下列程式虛擬碼(pseudo code)是要用來從一個非空串列(non-empty list)裡找出最大的數字。請問這個虛擬碼能否正確執行,並解釋你的答案。(12 分)
TestValue ← first list entry; 
CurrentEntry ← first list entry; 
While (CurrentEntry is not the last entry) do {
 if (CurrentEntry > TestValue) 
then (TestValue ← CurrentEntry)
 CurrentEntry ← the next list entry }