摘要:
LeetCode: 5. Longest Palindromic Substring class Solution { public: //动态规划算法 string longestPalindrome(string s) { int n = s.length(); int longestBegin 阅读全文
摘要:
LeetCode: 2. Add Two Numbers 阅读全文
摘要:
LeetCode: 3. Longest Substring Without Repeating Characters 阅读全文
摘要:
k 临近算法 算法步骤 k 临近算法的伪代码,对位置类别属性的数据集中的每个点依次执行以下操作: 1. 计算已知类别数据集中的每个点与当前点之间的距离; 2. 按照距离递增次序排序; 3. 选取与当前点距离最小的k个点; 4. 确定前k个点所在类别的出现频率; 5. 返回前k个点出现频率最高的类别作 阅读全文