Ren's Coding Note

什麼都在嘗試的網頁工程之路...

0%

題目說明

Implement a SnapshotArray that supports the following interface:

  • SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0.
  • void set(index, val) sets the element at the given index to be equal to val.
  • int snap() takes a snapshot of the array and returns the snap_id: the total number of times we called snap() minus 1.
  • int get(index, snap_id) returns the value at the given index, at the time we took the snapshot with the given snap_id
閱讀全文 »

前言

大學專題有思考過類似的問題,並有實際去嘗試過才想寫這主題。

因為室內定位真的是一門很廣的學問,何況藍芽的訊號干擾太多了,實作起來能說是困難重重…

閱讀全文 »