Re: [問題] 字串比較的問題
※ 引述《H45 (!H45)》之銘言:
: [...]
: 這邊仍然使用了iterator, 循序檢查, 花費時間 O(n)
: 如果改用Jump table, 或是Event trigger, 將可縮短花費時間 O(1)
如果要搜尋的目標不多的話,線性搜尋不見得比較慢,可能還更快
--
#!/usr/bin/ruby [露比] /Programming (Kn|N)ight/ 看板《Ruby》
# if a dog nailed extra legs that http://www.ptt.cc/bbs/Ruby/index.html
# walks like an octopus, and Welcome ~Ruby@ptt~
# talks like an octopus, then ◢█◣ http://www.ruby-lang.org/
# we are happy to treat it as █ http://www.ruby-doc.org/
# if it were an octopus. ◥ ◤ http://www.rubyforge.org/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.28.18
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 8 之 8 篇):