Search signals 為 Google 搜尋排名的考量指標之一,其中包含 Core Web Vitals 和 Mobile Friendly, HTTPS, No Intrusive Interstitials。
網站核心指標(Core Web Vitals)可以協助評估網站的使用體驗,並找出改進空間。若網站使用體驗不佳將會影響網站排名和SEO成效。
目前(2020年)使用者體驗專注於三個面向——載入速度(loading performance)、互動反應能力(Interactivity)、視覺穩定性(Visual Stability),並根據這三個面向延伸出三個主要的指標:
Largest Contentful Paint(LCP):測量從網頁載入到頁面中最大面積元素渲染到畫面上所花費的時間。
First Input Delay (FID):測量使用者與網頁互動,直到瀏覽器回應互動事件的時間差。
Cumulative Layout Shift (CLS):測量累計佈局偏移,即畫面發生未預期排版移動的程度。
Aquamay changed 2 years agoView mode Like Bookmark
Just like we have grammar rules and linguistic structures to frame our words and feelings into comprehensible sentences, we have design patterns and principles to shape our code.
...
SOLID, DRY, KISS, and YAGNI are not merely principles but are cornerstones of crafting good code.
Good code is like a love letter to the next developer who will maintain it.
文章中提及的 SOLID, DRY, KISS, YAGNI 都是設計原則,這些設計原則目的都是為了提高程式碼可讀性、提升可維護性。
Aquamay changed 2 years agoView mode Like Bookmark
一個二元樹通過線索連起來。所有原本為空的右(孩子)指針改為指向該節點在中序序列中的後繼,所有原本為空的左(孩子)指針改為指向該節點的中序序列的前驅。
假設該二元樹中序遍歷為 A B C D E F G H I,根據上述說明試著解讀為何這些節點的線索是這樣連的。
A 節點的左指針為空,因此指向其中序的前驅節點為 B,右指針要指向後繼,但它是第一個遍歷所以為空;C 節點的左指針指向前驅 B,右指針指向後繼 D...以此類推。
:::warning
線索二元樹能線性地遍歷二元樹,從而比遞迴的中序遍歷更快,並且建立線索並不影響時間複雜度。
使用線索二元樹也能夠方便的找到一個節點的父節點,這比多宣告一個父親節點指針來找 或者用 棧 效率更高。
Vanilla-wu changed 2 years agoView mode Like Bookmark
Easy
1. Two Sum
13. Roman to Integer
20. Valid Parentheses
21. Merge Two Sorted Lists
53. Maximum Subarray
58. Length of Last Word
70. Climbing Stairs
101. Symmetric Tree
Aquamay changed 3 years agoBook mode Like Bookmark
題目概要
給定一個大小為 n 的整數陣列 nums,返回使所有陣列元素相等所需的最小移動次數。
每一步可以將陣列中的 n - 1 個元素加1。
Example 1:
Input: nums = [1,2,3]
Output: 3
Explanation: Only three moves are needed (remember each move increments two elements):
Aquamay changed 3 years agoView mode Like Bookmark
題目概要
給定一個字串(句子),並給定一個正整數 k,將字串中的前 k 個單字輸出。
Example 1:
Input: s = "Hello how are you Contestant", k = 4
Output: "Hello how are you"
Explanation:
The words in s are ["Hello", "how" "are", "you", "Contestant"].
The first 4 words are ["Hello", "how", "are", "you"].
Aquamay changed 3 years agoView mode Like Bookmark
題目概要
給定一個整數陣列 arr 和三個整數 a, b, c,你需要找到 Good Triplets 的數量。
Good Triplets 須滿足以下條件:
0 <= i < j < k < arr.length
|arr[i] - arr[j]| <= a
|arr[j] - arr[k]| <= b
|arr[i] - arr[k]| <= c
Aquamay changed 3 years agoView mode Like Bookmark