沒限制
一開始是選二戰,但覺得範圍太大
後來選納粹 做了 2/3 後才發現好像寫成教科書了
演算法是不是就是寫個程序去處理input再把結果Output 🤔
Umm… 原來我是會…
只不過不知道原來這也是演算法
int a(int hi) { return hi + 1; } 這是演算法
所謂演算法 design pattern...etc,本來就是把某些共通的動作釐清定義,然後給他個名稱阿
就像說...難不成今天你不知道「eat」這個字的定義,就不會去吃飯了嗎,肚子餓該吃還是要吃吧,只是你不知道這個詞啥意思而已,不妨礙你吃飯
只是問題在於...你要跟別人溝通說我要去吃飯了這件事,你就不知道怎麼講了
用澆花用噴瓶的壓力噴出來,應該可以跟空氣均勻混合,達成完沒燃燒條件
Assertion: "state->readTill >= tillId" data_histories.cpp:414
最新版 telegram desktop 是不是有 bug,十分鐘內噴掉兩次了
你們面紙會放面紙盒嗎?還是裸著用,用完塑膠袋直接扔掉?
沒負離子,你只會弄到滿地水,空氣濕度增加,灰塵依然到處跑
但是有負離子也是有條件的變好而已,顆粒太大的負離子吸不動🤣
int rand() { return 4; } 這也是演算法
int main() { return 0; } 呢?
main之前有一個_start去init crt再main的
An algorithm is just a formally specified procedure for solving a computational problem. A computation problem is just a formal description of input and output. For example, the sorting problem can be defined as follows:
Input: A sequence of n numbers <a1, a2, ..., an>
Output: A permutation (reordering) <a1', a2', ..., an'> of the input sequence satisfying the ordered property: a1' <= a2' <= ... <= an'
There's nothing special about the usage of the word algorithm and what you write everyday
As long as you can explicitly define a computational task and the steps to compute, you are working with algorithms. However, I don't think many people can come up with well-known algorithms with their original research. Even if they can, it is a waste of time.
That is, of course, assumming the set {a1, a2... an} is a totally-ordered set
A few more example to ponder with: Given a set of vertices V of a directed acyclic graph, we can define a relation -> such that V is totally ordered.
You sure persons who didn't know what "algorithm" is will know what is "totally-ordered set"?
Well ordered should suffice....
As long as every nonempty subset has a least element
We can produce an ordered sequence
I'm sure people who did not know what algorithms mean will learn and not come up with their own definition
Just out of curiosity, how do you find this group, and why are you replying message in English instead of Chinese?
Because I have been learning computer science stuffs in English
Now we are bestowed the ability to define computational problems, let's try to define a few of them.
1.
Input: A list of unique 32 bit integers plus 1 duplicate
Output: The duplicated integer
2.
Input: An imperative program
Output: The list of no longer used variables after executing the n-th machine instructions
3.
Input: A seed integer
Output: A stream of integers that is deterministic (entirely upon the seed), satisfying the uniform distribution.
Just out of curiosity, why u replying in English too
By now we should've realized that a well-defined problem is a problem half solved. We should define what the problem is before defining an algorithm lol
We can readily supply an algorithm for (1) if we are acquainted with the ubiquitous set data structure.
let s be an empty set
for i in list:
if i in s:
return i
s.insert(i)However, we can do better. There is a O(n) time O(1) memory algorithm hidden in the wild, which is quite nontrivial. However, everyone with a basic understanding of data structure can devise the algorithm outlined above immediately.
(2) is sadly undecidable, a situation much more horrid than being NP-hard. If you're familiar with languages that have garbage collection facilities, you should be wondering, how do they even do that?
The truth is, you have been lied on... They implement gc using an approximation algorithm. They only clear all the dead nodes (the definition of dead node varies as the underlying algorithm changes), which is a subset of nodes no longer used
You can observe that the definition of dead node in the mark-sweep, reference counting, and Cherny algorithm are all different, as least slightly
問個,有辦法限制使用者只在我的web app操作嗎~
設備是我們這邊提供,只是會開放給大家使用,但沒想到好方法可以限制使用者
這樣感覺要投入好多android跟ios設備,這邊是希望用筆電就可以完成
你找個 force focus on top 的 app
+ electron 或是其他可以寫死網址的瀏覽器
然後你去找 jcuda 的 jar
java -cp jcuda.jar -cp /path/to/src/company com.company.Main
為什麼他沒有給 maven 或者 gradle 的設定檔啊