2021年10月1日 星期五

Distance 筆記

最近一直寫 Leetcode,部落格也就荒廢許久,想說突破 200 題來分享一下心得。

Distance question

Leetcode 上有很多問題是關於距離,這裡紀錄下一些有用的數學概念。
  • 平均值 (mean)
    平均值的歐幾里得距離最短 (4*4 + 4*4 < 1*1 + 7*7)
    但相乘值最大 (4*4 > 1*7)
  • 中位數 (median)
    中位數的絕對偏差值最低 (跟其物件的距離之總和最短)
  • 眾數 (mode)
    mode minimizes distance for indicator function (理解不能)
    這個我沒寫過類似的,寫過後我再更新。
參考資料 :
1.leetcode/discuss

Related Posts:

  • JQuery - $( document ).ready() JQuery - $( document ).ready() 鑒於 $( document ).ready() 有縮寫,導致初學者如我看不懂,這裡紀錄一下。 基本版本 $( document ).ready() 基本上是等 Document Object Model ( DOM ) 好了後,可以執行 JavaScript code 時啟動。另外常見的 $( window ).on( "load", funct… Read More
  • 讀書心得 - C++ Primer (5th Edition) - Chapter 2 (1) - Primitive Types C++ 原生內建的資料型態 ( Primitive Types )     C++ 定義了一些算術用的資料型態 ( Arithmetic Types ) 和一個特殊的資料型態 void。Arithmetic Types : Integer, Character, Boolean, Floating Point, Double Floating Point, Wide Character。     下面為一… Read More
  • Git - 刪除 submodule Git - delete submodule 因為上網 Google 這問題你會發現這個Stackoverflow和這個Github的答案。很久以前查的時候 stackoverflow 置頂的答案是以前最多 upvote 的答案,也就是 githb 的答案。但 git 在版本更新後那個 7 步刪除 submodule 的已經過時了。雖然還是可以用但現在三步就可完成。 # 用 git submodule deinit… Read More
  • Google API 筆記總覽 Python Google API - Python 學習筆記 Google API - Python 學習筆記 - Upload post … Read More
  • Google API - Python 學習筆記 - Upload post Google Blogger API Table 其實找到好用的 Google API document 就完成 80% 了,這裡紀錄 Python 連結。再紀錄個 Google 給開發者用的 Playground,可以讓你先試試 API。 Post article 這裡紀錄程式碼模擬平常的流程,但其實可以只用 insert 就完成所有事。 New Post 新增草稿。 # Create a… Read More

0 意見:

張貼留言

Popular Posts