Google資料分析課程筆記-5
Course 5 - Analyze Data to Answer Questions
簡介
This is the fifth course in the Google Data Analytics Certificate. In this course, you’ll explore what it means to actually analyze your data. You’ll take what you’ve learned up to this point and apply it to make sense of the data you’ve collected. You’ll learn how to organize and format your data using spreadsheets and SQL to help you look at and think about your data in different ways. You’ll also find out how to perform complex calculations with ...
Google資料分析課程筆記-4
Course 4 - Process Data from Dirty to Clean
簡介
This is the fourth course in the Google Data Analytics Certificate. In this course, you’ll continue to build your understanding of data analytics and the concepts and tools that data analysts use in their work. You’ll learn how to check and clean your data using spreadsheets and SQL, as well as how to verify and report your data cleaning results.
章節大綱
The importance of integrity
學習檢查資料完整性以及數據不足的處理方式,了解隨機抽樣對於避免抽樣偏差的重要性。
Clean data for more accurate ...
Google資料分析課程筆記-3
Course 3 - Prepare Data for Exploration
簡介
This is the third course in the Google Data Analytics Certificate. As you continue to build on your understanding of the topics from the first two courses, you’ll be introduced to new topics that will help you gain practical data analytics skills. You’ll learn how to use tools like spreadsheets and SQL to extract and make use of the right data for your objectives, and how to organize and protect your data.
章節大綱
Data types and structures
學習數據是如何產生的以及分析師 ...
Google資料分析課程筆記-2
Course 2 - Ask Questions to Make Data-Driven Decisions
簡介
This is the second course in the Google Data Analytics Certificate. You’ll build on your understanding of the topics that were introduced in the first course of this certificate program. The material will help you learn how to ask effective questions, make data-driven decisions, and meet stakeholders’ needs.
章節大綱
Ask effective questions
在這個單元內學習如何進行有效的提問,良好的提問可以讓整個分析的流程變得更加順利。
Make data-driven decisions
本單元介紹數據如何去驅動的各種業務方面的決策,並且學習如何透過報告和 ...
Google資料分析課程筆記-1
Course 1 - Foundations: Data, Data, Everywhere
簡介
This is the first course in the Google Data Analytics Certificate. Organizations of all kinds need data analysts to help them improve their processes, identify opportunities and trends, launch new products, and make thoughtful decisions. In this course, you’ll be introduced to the world of data analytics through hands-on curriculum developed by Google. The material shared covers plenty of key data analytics.
章節大綱
Introducing data analytics and a ...
演算法筆記-二分搜尋
二分搜尋是一個比循序搜尋還要有效率的常用搜尋方式,主要邏輯為反覆將搜尋範圍減半直到找到目標為止,但是除了最基本的寫法之外還有另外兩種寫法,也有很多小細節是需要注意的。
一點小細節
循環 & 終止條件
left <= right
當循環條件為 left <= right 時,代表會在 left == right + 1 時結束,此時區間為空,代表可以直接回傳 -1 ,target 不在陣列之中。
12345678910111213class Solution {public: int search(vector<int>& nums, int target) { int left = 0, right = nums.size() - 1; while(left <= right){ int mid = (left + right) / 2; if(nums[mid] == target) return mid; ...
演算法筆記-雙指針
雙指針是在陣列處理時可以利用的技巧,利用兩個指針去做判斷或是構造出窗口幫助解題,根據兩個指針的特性可以分為對撞指針、快慢指針以及滑動窗口。
對撞指針
兩個指針在數列兩端,移動方向相反,向中間移動,通常終止條件為兩指針對撞 or 滿足題目需求,兩邊指針的移動條件則要視題目需求做判斷。
LeetCode 167. Two Sum II - Input Array Is Sorted
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.
Return the indices of the two num ...
演算法筆記-3
三維迷宮問題
給定一個三維的迷宮,起點標示為 S ,終點標示為 E ,# 代表牆壁,. 表示道路,每次移動所需時間相同,計算出從起點到終點的最短時間。
其實就是二維迷宮的推廣而已,可以同樣用 DFS 解決,此時每次可前進的方向會有 6 個,分別為前、後、上、下、左、右,而判斷邊界時也要注意 x, y, z 都要判斷。因為題目必須判斷最短時間,因此要多加一個變數 dis 來儲存當前的最短步數。
部分程式碼:
12345678910111213141516171819202122232425//6個方向int dir[6][3] = {{1, 0, 0},{-1, 0, 0},{0, 1, 0},{0, -1, 0},{0, 0, 1},{0, 0, -1}},dis = 30000; //判斷邊界函數bool check(int a, int b, int c, int z, int y, int x){ return (0 & ...
離散筆記-卡塔蘭數
卡塔蘭數 Catalan Number
卡塔蘭數 (Catalan Number) 是組合數學中一個常在各種計數問題中出現的數列,數列的前幾項分別為:1, 1, 2, 5, 14, 42, 132, 429…
定義公式
C0=1,C1=1C_0 = 1, C_1 = 1C0=1,C1=1
一般項公式:
Cn=1n+1Cn2n=Cn2n−Cn−12nC_n = \frac{1}{n+1}C_{n}^{2n} = C_{n}^{2n} - C_{n-1}^{2n}Cn=n+11Cn2n=Cn2n−Cn−12n
遞迴公式:
Cn+1=∑i=0nCiCn−iC_{n+1} = \sum_{i=0}^{n}C_{i}C_{n-i}Cn+1=∑i=0nCiCn−i
or
Cn=∑i=1nCi−1Cn−iC_{n} = \sum_{i=1}^{n}C_{i-1}C_{n-i}Cn=∑i=1nCi−1Cn−i
應用
路徑問題
在一個 n * n 的格點中,從左下角 (0, 0) 到右上角 (n, n),每一步只能向右或向上,不穿越對角線的總路徑數。
n = 4 的情 ...
演算法筆記-2
樹的遍歷
重建樹
根據給定原始樹的先序遍歷 (preorder traversal) 和中序遍歷 (inorder traversal)重構原始樹。
前序遍歷的順序為 [根結點、左子樹、右子樹],而中序遍歷的順序為 [左子樹、根結點、右子樹],因此我們可以透過前序遍歷的第一個元素找到根結點,將其帶入中序遍歷,就可以找到左、右子樹,對左、右子樹遞迴進行此行為就可以構造出原始樹,
函式程式碼:
123456789101112131415161718TreeNode* BuildTree(string preord, string inord, int preord_left, int preord_right, int inord_left, int inord_right) { if (preord_left > preord_right) { return NULL; } //從前序遍歷中取得根結點 int preord_root = preord_left; //找到根結點在中序遍歷中的位置 in ...














