---
# System prepended metadata

title: Linux Kernel開發學習日誌2020.3.1

---

# Linux Kernel開發學習日誌2020.3.1


# 行動筆記
* git fork v.s. clone 資訊提取 1 tomato
    * 衍伸問題
        * What is ```upstream```
* [2020q1 Homework1 (lab0)](/@unknowntpo/lab0-c)
* [Queue 基本概念學習](https://www.youtube.com/watch?v=gnYM_G1ILm0) 2 tomato
    * 資訊提取 
---

# 構思筆記
## Queue 基本原理
[Queue | Data Structures Tutorial | Mr.Srinivas
](https://www.youtube.com/watch?v=gnYM_G1ILm0)

* Queue
    * 就像排隊點餐
    * is a Data Structure 
    * is an Algorithm
    * Linear Data Structure
    * FIFO (First in First Out)
    * Can be implemented 
        * Statically
            * e.g. array.
        * Dynamically 
            * e.g. linked list
------


### Queue 概念解釋

* front[0]: 顯示front 現在在 0 的位置
    * fixed, 固定不動
* rear[0]: 顯示 rear 現在在 0 的位置
* if front positon = rear position
    * --> queue is empty !

<br>

<img src= "https://i.imgur.com/xCUjixH.png" height=300/>
<br><br>





----

#### Insert a number to queue

* now,
    * front[0]
    * rear[1]  <-- rear move to position 1

<br>
<img src= "https://i.imgur.com/9WtEocd.png" height=300/>
<br><br><br><br>





----

#### Insert Again a number to queue

* now,
    * front[0]
    * rear[2]  <-- rear move to position 2

<img src= "https://i.imgur.com/HBsO6bz.png" height=300/>




-----
#### When Queue is full

* rear position is outside of queue

<img src= "https://i.imgur.com/6Vznccz.png" height=300/>

-----
#### Queue Deletion

* 要照順序？
    * guess: 是，因為要遵守 FIFO 概念
* Deletion 的行為
    * Step 1: 刪除 element: 10
    * Step 2: 把其他的 element 往 front 的方向移動
    * Step 3: 更新 rear position. 

<img src= "https://i.imgur.com/HI2ME7Z.png" height=300/>




---
# 封存筆記

### 學習：列出所有前置作業與小步驟
>參考 makefile build 出檔案的方式來學習
* target: e.g. linked-list 實作
* prerequisites: c structure. NULL pointer. Dynamic_memory allocation...
* command: 學習過程 (記載在開發筆記內)
```make
target: prerequisites
    command
```

### Git: Fork v.s. Clone

我的資訊提取

<img src= "https://i.imgur.com/bT97XEg.png" height=400/>
* 參考昨日筆記 [Linux Kernel開發學習日誌2020.2.29](/BEmlUOofSNiFGChHuFherg)