亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Seasoned Schemer一書中,第12頁的scramble函數,描述是什么意思?

Seasoned Schemer一書中,第12頁的scramble函數,描述是什么意思?

MMTTMM 2018-12-18 19:49:01
函數描述:The function scramble takes a non-empty tup in which no number is greater than its own index, and returns a tup of the same lenght. Each number is the argument is treated as a backward index from its own position to a point earlier in the tup. The result at each position is found by counting backward from the current position according to this index.What's the value of (scramble tup) where tup is (1 1 1 3 4 2 1 1 9 2)Answer: (1 1 1 1 1 4 1 1 1 9)
查看完整描述

1 回答

?
楊__羊羊

TA貢獻1943條經驗 獲得超7個贊

一開始我也沒看懂,后來看了函數的定義才弄明白了,新的列表的每個子元素是原來每個對應子元素的向前追溯其值個.1就代表本身,2就是前一個.

查看完整回答
反對 回復 2018-12-18
  • 1 回答
  • 0 關注
  • 779 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號