原创 算法競賽入門經典 (第二版)習題【第一章】
1-4 正弦和餘弦 #include<stdio.h> #include<math.h> int main(){ int n; scanf("%d",&n); const double p
原创 在Pycharm中使用Jupyter
在terminal 輸入jupyter notebook
原创 Python 可變對象和不可變對象
Python 可變對象和不可變對象 不可變對象:數值類型(int,float),字符串string,元組(tuple) 可變對象:list,set,dict 不可變對象:對象所指向的內存中的值不能被改變,當改變這個變量值的時候,
原创 Python 錯誤和異常
Python 錯誤和異常 0. 只看一眼: 格式: try: ... except Error1: ... except Error2: ... ... else: ... finally: ... with
原创 Week2 Exercise 1: Linear Regression Visualizing J 代碼詳解
Week2 Exercise 1: Linear Regression part 4: Visualizing J 目的:繪製cost function J(θ\thetaθ 0 , θ\thetaθ 1)隨自變量θ\thetaθ 0
原创 閒聊
閒聊 在自己學完coursera上機器學習課的新知識後,會在這個分類下記錄下所學的新知識。 希望每一步都能學得紮實。 課堂總結比較少,大多是關於作業、matlab代碼部分的補充說明。 自己對Matlab很生疏,所以在學習過程中,會着
原创 LeetCode 100.Same Tree\872.Leaf Similar Trees 收穫
100.Same Tree 此題思路正確,用遞歸,但是原本代碼表達得十分不簡明。 如下: bool isSameTree(TreeNode* p, TreeNode* q) { if((p==NULL&&q!=NULL)
原创 算法競賽入門經典 (第二版)習題【第二章】
習題2-1 水仙花數 代碼: #include<stdio.h> int main(){ for(int i=100;i<=999;i++) { int a=i%10; int b=(i/
原创 算法競賽入門經典 (第二版)【習題】
1-4 正弦和餘弦 #include<stdio.h> #include<math.h> int main() { int n; scanf("%d",&n); const double pi=acos(-1);/