# 2023年 資訊科技產業專案設計 作業2 >contributer: 哈囉hi >[video](https://youtu.be/MZo6pdYAtsg) :man: imterviewer :woman_in_lotus_position: interviewee ## [Search in a Binary Search Tree](https://leetcode.com/problems/search-in-a-binary-search-tree/?envType=study-plan-v2&envId=leetcode-75) :man:: Hi , I'm Jo. I'm here to see your coding style for my collegues . You could just feel free to express youself , I'm all ears :woman_in_lotus_position: : Thanks , it really ease my nerve. :man:: So , we recently help a clinic to maintain their documantation system . All the document is labeled by Id card number , and we need to find the target file . :woman_in_lotus_position: : Ok , so I will have a dataset and target , and I need to take the file . But , what's the size of the dataset? :man:: The dataset has at most 10^5 files. :woman_in_lotus_position:: I see . Please give me a moment to brainstorm ... first , maybe we could just go through the array with for loop . Its time complexity will be O(n).Below is my code. >程式碼 ```c++= class Solution { public: int location(int* array, int val) { for (int i=0 ; i< sizeof array ; i++){ if (array[i]==val) return i; } } }; ``` :man:: Ok , but have you thought about the speed of this method . If the dataset grow bigger , and we are going to find the file of a patient in urgent need , we might need to save any minute . Maybe you could have the data being processed so that you could just search for a part of the dataset . :woman_in_lotus_position:: Maybe we could store the data in a binary search tree . With this case , it would be faster to find the wanted one since it has been sorted with its value . For example ![](https://hackmd.io/_uploads/ryrrkwOAn.png) in this photo , if we want to find the 1 in the trees , we could just look it up in the left hand part of the tree . And make the time comlexity be O(logn) Besides , since a BST would have bigger node in the left hand part , and smaller one in the right hand part , so we could use a if else to help it find the targer node quicker >程式碼 ```c++= class Solution { public: TreeNode* searchBST(TreeNode* root, int val) { if(root == NULL) return NULL; if (root->val == val) return root; else if (root->val >val) return searchBST(root->left , val); else return searchBST(root->right , val); } }; ``` :man:: That's great. Can you also show me the way you process the data to be binary search tree? :woman_in_lotus_position:: Let me explain it with the example below ``` If there are odd number to choose , we would choose the right one in the middle one Given the data 13,24,32 we choose the center value 24 as the first node the binary tree would be 24 13 32 If there are even number to choose , we would choose the right one in the middle one Given the data 1,23,25,43,53,72,80,90 we choose the center value 43 as the first node then we choose the 43 23 80 1 25 72 90 53 ``` :man:: Thanks for your effort today . I really enjoy this conversation ! ## 初步檢討 :man: interviewer + **引導解題的方式不夠深入** 對於演算法的精進可以適度給予提示 ,或是引導interviewee去分析不同演算法的時間與空間複雜度,甚至是應用場景的細節 + **延伸原本問題的技巧** 若是能跳脫原本問題的框架,以延伸的想法與interviewee互動,或許更能挖掘出自己想要的人才 :woman_in_lotus_position: interviewee + **寫程式時說話音量太小** 要保持interviewer聽得清楚的音量 ,或是盡量在coding前的解釋補充得更清楚 ,就不需再coding時分心解釋 + **表達流暢度的精進** 會有過多語助詞以及窮詞的狀況,若能流利地表達能給interviwer自己是well-prepared and confidence 的印象 ## **OVERVIEW 對他人的評論:** ### 針對interviewer的評論: #### 優點: * 題目說明非常明瞭。 * 對於用問題引導interviewee面試方向處理得很不錯 #### 可改進之處: * 只有簡單的回覆,沒有挖掘到更深入的問題 * 太有上對下的壓迫感,對於之後的工作氣氛可能會有影響 ### 針對interviewee的評論: #### 優點: * 英文咬字清晰 * 將REACTO的方式清楚條理地在面試中呈現 #### 可改進之處: * 不要用鼠標在要強調的地方一直轉,給Interviewer的感覺會很差,可利用反白即可 ## **經過HW1以及HW2他評後學習到了什麼?** 經由評論別人找尋其他人的缺點以及優點時,我也發現了自己的一些缺失。其中: ### 可改進的部分 1. 沒有將題目從leetcode原題包裝成與實際問題相關的例子 2. 語助詞太多 3. 注意專業用詞的使用方式 ### 繼續保持的優點 1. 咬字與發音的清晰 2. 整體節奏的掌控,能讓對話以平順的步調進行 3. 能將要表達的事項有條理地描述 ## 作業4 - 他評 ### 針對interviewer的評論: #### 優點: - [7:11](https://youtu.be/MZo6pdYAtsg?t=431) : 有互動 #### 可改進的部分 - 可以將interview 跟 interviewer的字,不只是加在英文字幕裡 - [21:36](https://youtu.be/MZo6pdYAtsg?t=1296) 在詳細詢問這樣的時間複雜度為何,讓interviewee說明optimize的幅度 ### 針對interviewee的評論: #### 優點: - 英文很流利,可以不用看字幕也聽懂 - [1:42](https://youtu.be/MZo6pdYAtsg?t=102) : 會與interviewer互動 - [10:11](https://youtu.be/MZo6pdYAtsg?t=611) : 有附圖說明有助於解釋 #### 可改進的部分 - 分享螢幕右邊的全新推出不分頁格式可以關掉。比較不干擾 - [4:00](https://youtu.be/MZo6pdYAtsg?t=240) : 未具體說明O(N)的由來,比如worst case 就是全部跑過,可以說都是線性的訪問每個元素說法。 - [19:54](https://youtu.be/MZo6pdYAtsg?t=1194) : 說明為什麼odd number 就是選mean even number是選middle number