2026-09-08
Selecting...
Home Page
reload
Search in this channel...
Punch card
Raw Text (irssi format)
Fork on github
switch to admin mode
Jump to...
redirecting...
Log for
*新手討論群
pm 09:53:20
王 彥
想問一下,最近寫題目用Vector的次數頻繁了很多,感覺Vector就是Array的上位版,那建不建議平常都使用Vector來存東西?濫用Vector會有怎樣的問題嗎?
pm 10:05:34
instanceof@tg
Vector 是 Complex Type--有點耗記憶體,但有邊界檢查。
如果你在寫底層、競賽程式,或是比較要求記憶體或速度的場合,盡量用原生的 Array,然後自己做邊界檢查和 push 處理。
如果不是以上情況,用 vector 肯定利大於弊。
pm 10:06:06
王 彥
ok 感謝
created by
mmis1000
and release under
MIT License
GitHub Repo