原创 模型常用評估指標

模型常用評估指標 L0 範數、L1 範數、L2 範數、餘弦距離 向量的範數可以簡單形象理解爲向量的長度,或者向量到零點的距離,亦或是相應兩個點之間的距離。因此範數通常會對應一個距離概念。 L0 範數 L0 範數表示向量中非零元素的

原创 【LeetCode】206. 反轉一個單向鏈表

問題描述 Reverse a singly linked list. A linked list can be reversed either iteratively or recursively. Could you implement

原创 【LeetCode】121. 買入和賣出股票的最佳時間

問題描述 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted

原创 【LeetCode】448. 找到數組中沒有出現的元素

問題描述 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear on

原创 【LeetCode】581. 最短的無排序連續子數組

問題描述 Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending

原创 【LeetCode】22. 生成括號

問題描述 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 給定n對括號,編寫一

原创 【LeetCode】198. 入室偷竊

問題描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stas

原创 【數據庫】數據庫入門(七): 函數依賴(Functional Dependencies)

前言 一個設計良好的數據庫模式(database schema),應該要具備以下特點: 完整性(Completeness) 減少冗餘(Redundancy freeness) 一致的含義(Consistent understanding)

原创 【LeetCode】437. 路徑求和(三)

問題描述 You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a g

原创 【數據庫】數據庫入門(八): 數據庫規範化(Normalisation)

前言 數據庫規範化的產生主要是由模式設計(Schema Design)而推動的。模式設計的目標是爲特定的數據庫應用程序選擇最合適的模式。模式的選擇由用戶提供和依賴項捕獲的應用程序數據的語義信息指導。 常見的方法是從一個普遍的關係開始,並應

原创 【LeetCode】70. 爬樓梯

問題描述 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps.

原创 【數據庫】數據庫入門(十一): 數據庫安全(Database Security)

主要目標 當我們談及數據庫安全的時候,主要是希望實現三個目標: 機密性(Confidentiality):數據只能展示給那些獲得權限允許訪問的用戶對象。 例如,由存取控制機制執行 完整性(Integrity):數據只能被擁有修改權限的

原创 【數據庫】數據庫入門(九): 關係代數(Relational Algebra)

前言 關係代數的出現,主要是源於對聲明性語言與程序性語言的討論,兩邊的代表分別是 SQL 和 關係代數(RA)。 SQL是一種聲明性查詢語言,它描述希望獲得的元組集合,爲了數據庫中有效地實現查詢,需要將 SQL 查詢轉換成過程性程序。 關

原创 【數據庫】數據庫入門(十): 查詢優化(Query Optimisation)

查詢處理 用戶提交 SQL 查詢請求給數據庫管理系統 數據庫管理系統處理和執行 SQL 請求,從數據庫中獲取相應數據並返回。 由於 SQL 只是一種聲明性的語言,因此 DBMS 需要決定如何執行 SQL 查詢語句。 自上而下執行 SEL

原创 【LeetCode】238. 除去自身後,數組各項的乘積

問題描述 Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the product