Corn

@AlanCorn

現為軟體工程師,持續進修與學習新知識!

Joined on Feb 19, 2024

  • Smart Pointers 在 C++11 中的標準模板庫(STL,為了要解決記憶體洩漏問題(Memory Leak) 的問題,便引進了Smart Pointer來更方便管理記憶體,而標頭檔案為 <memory> Smart pointers enable automatic, exception-safe, object lifetime management. cppreference :::danger 如果在free跟delete前程式碼就爆開了,當記憶體空間沒有釋放到一定程度就會爆開 :::
     Like  Bookmark
  • 何謂 Makefile? 在軟體開發中,make 是一個工具程式,藉由由讀取一個叫做 makefile 的檔案,自動化建構軟體。 make 是linux中的命令工具,它可以用來解析 Makefile 中的指令。 Makefile 則是一份用於管理和自動化編譯流程的配置文件,它明確指定計算機如何編譯、連結程式碼,並在大型專案中通過設計的規則顯著提升效率,減少不必要的編譯時間。 :::success make 可以解決相依性問題 透過撰寫規則,減少編譯時間,減少重複編譯過程,只需編譯有修改的 可以透過Makefile來掌握程式碼架構 :::
     Like 1 Bookmark
  • 圖片1 簡介 本文是學習筆記,學習開源程式碼OpenCV中的實作,並且學習其中所使用的概念 Mat Implementation struct Mat { /*! includes several bit-fields: - depth (4~-11)
     Like  Bookmark
  • 資料整理 Corn 議題 偵測環狀結構 排序問題確保空間複雜度為 $O(1)$ Traverse Linked List 在 Linux 核心程式碼 在linux/list.h為Linked List中以circular doubly-linked list(雙向環狀鏈結串列) 進行實作,只要在自定義的資料結構中加入struct list_head便可以透過Linux List list的api進行操作。如下圖所示,也就是將其嵌入自定義的資料結構。 image
     Like  Bookmark
  • Introduction 陣列為一種在記憶體空間連續分布的資料型態,陣列中的東西我們稱作元素(element),陣列能夠透過元素的索引(index) 來取得資料。 連續記憶體分布 為靜態的,不能改變大小 透過索引索取資料,索引時間複雜度$O(1)$ Array 在C語言中 以下為宣告陣列一個方式, arr 宣告成有 5 個元素的陣列,元素資料型態為 int ,在32/64位元系統底下,int 佔 4 byte,對於arr來說使用sizeof測量陣列大小時會輸出 4 * 5 = 20 byte。
     Like  Bookmark
  • Leetcode 解題筆記 === String 字串 【LeetCode】344. Reverse String Array 陣列 【LeetCode】844. Backspace String Compare 【LeetCode】704. Binary Search 【LeetCode】59. Spiral Matrix II
     Like  Bookmark
  • Question link Link Intuition Given the root of a binary tree, return the preorder traversal of its nodes' values. (給定一個二元樹的根,返回前序走訪過程中經過節點的數值) 經典的樹走訪問題,此題目共三種解法,羅列如下 Recursive
     Like  Bookmark
  • Question link Link Intuition Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). (給定一個二元樹的根,返回層序走訪過程中經過節點的數值,順序為左至右) 經典的樹走訪問題,此題目共二種解法 Recursive
     Like  Bookmark
  • Model structure ![image](https://hackmd.io/_uploads/rkdKVnXkke.png =75%x) Post Process 在圖片輸入到模型後,並針對輸出做一些操作,然而在export成不同部屬模型格式的時候,這些操作會影響之後的計算圖的生成,因此我們需要多做些修改 我們從YOLOv8(現行為YOLO11了)來進行部分程式碼的解讀 [ultralytics/nn/modules/head.py] class Detect
     Like  Bookmark
  • Question link Link Intuition Given the root of a binary tree, invert the tree, and return its root. (給定一個二元樹,請翻轉整個樹) image Recursive✔️ Pre-order, NLR(Node-Left-Right) ✔️ In-order, LNR(Left-Node-Right)
     Like  Bookmark
  • 1. Intro One pictures is worth more than thousand words. 一圖勝千言,表示一張影像資訊,能夠涵蓋大量的資訊 Digital Image 數位影像 數位影像代表一組二維數組$(x,y)$上有特定數值,代表著亮度或顏色 以特徵的角度思考對於人類,圖像有著豐富的資訊,包含顏色、紋理、邊界,對象,位置等等,這些特徵又可再細分為低中高階特徵 對於電腦,這些就僅只是數字的集合(set)而已,因此就需要演算法來將這些集合轉換成有意義的東西🤣 在影像處理任務的挑戰
     Like  Bookmark
  • Question link Link Intuition Given the head of a singly linked list, reverse the list, and return the reversed list. (給定串列鏈結,將其翻轉並將其回傳) image 題目要求需要翻轉整個串列鏈結,首先需要了解翻轉一個節點所需要的資訊是
     Like  Bookmark
  • 簡介 這兩個巨集對於Linux核心原始程式碼非常的重要,它適用的範圍非常廣泛,被應用在Linked List與hash Table這一通用的資料結構中,用來化簡程式設計,並讓C語言也具備物件導向的行為,也是Linux物件導向中相當重要的機制! offsetof 巨集 #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif 目的 : 取得結構體內成員相對於結構體起始位置的位移量size_t : 表示一個byte的單位 :::success 操作細節
     Like  Bookmark
  • 前言 :::info 錄影內容 排程器原理(上) ::: Scheduling Internals Scheduling動畫說明,說明Scheduler如何安排任務, Deadline每個任務要在特定時間內執行完
     Like  Bookmark
  • 目錄 深度思維 ![image](https://hackmd.io/_uploads/Hk0srgz9R.png =50%x) 思維邏輯鍊,能夠認知較長的因果關係 靈活看待問題的視角 面對較大資訊量,能夠在資訊流中找到關鍵,保持思維能力 在宏觀視角上分析問題,跳脫自己框架,認知事務與生態特性、事務的長期趨勢
     Like  Bookmark
  • Question link Link Intuition Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. 給定字串s,將其翻轉 :::info 最直接想法就是直接使用新的一個字串,並從尾到頭歷遍字串,但是需要O(n)的空間,因此如果使用雙指標法的話就不需要這麼多空間,直接交換頭尾兩個指標的字元就好 :::
     Like  Bookmark
  • Question link Link Intuition :::info 題目表明給定是兩個 non-empty 的ListNode,表示的數字以 reverse-order 儲存,這意味著低位數字放在ListNode 的開頭,我們需要將兩個數字相加並以相同的方式返回ListNode ::: Approach :::info
     Like  Bookmark
  • Question link Link Intuition Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head. (給定一個鏈結串列與整數,移除掉所有鏈結串列中等於val的節點並回傳新的head) :::info 題意要求移除掉ListNode的值符合val時要移除掉,也就是在遍歷過程中,如果遇到下一個節點是符合條件的,就將其跳過連接到下下一個節點。
     Like  Bookmark
  • Question link Link Intuition Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. 給定一個整路n,以迴旋方式產生一個陣列,並將數字從1填充到n2 :::info 題目要求以迴旋方式將數字填入到矩陣中,因此我們需要考慮每一個邊,該如何設計迴圈的操作條件,依舊是要堅持迴圈不變量的原則,填充的順序為 上列為由左到右
     Like  Bookmark
  • Question link Link Intuition Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. You must write an algorithm with O(log n) runtime complexity. 給定一個整數陣列,以升序排列,並給定一個target整數,請撰寫一個函數尋找targets在整數陣列的索引位置,如果沒有找到就回傳-1,演算法要求時間複雜度必須 O(log n) :::info 題目就是希望我們使用二分搜尋來找到相對應的目標,如果看到題目為是有序陣列以及無重複元素的話,基本上就是用二分搜尋來解題了,二分收尋最重要的就是邊界條件的處理,邊界分為四種
     Like  Bookmark