Philocode – Telegram
ما از فردا کتاب Grokking Algorithms رو می‌خونیم.
دلتون بسوزه.

(پوزخند مشهور مخصوص خود را اجرا می‌کند)
😁7😢1
🔥3
Philocode
Photo
نویسنده، بحثش رو با simple search و binary search شروع کرده.
1 2 3 4 5 6 7 8 9 10 11 12
توی دنبالۀ بالا، simple search از 1 شروع می‌کنه و یکی یکی جلو میاد تا عدد 11 رو پیدا کنه. اما با binary search از 1 شروع نمی‌کنیم و همیشه از وسط می‌پرسیم؛ اگه وسط این دنباله از 11 کوچیک‌‎تر باشه، نصف اول دنباله حذف می‌شه و در غیر این صورت نصف دوم دنباله رو حذف می‌کنیم!

یعنی اگه یه دنبالۀ 240,000تایی داشته باشیم و دنبال موردی بگردیم که آخر دنباله‌ست، با simple search (که نویسنده بهش میگه stupid search) در واقع 240,000 مرحله طول می‌کشه که پیداش کنیم ولی با binary search تنها 18 مرحله نیازه!
#GA
👍5
It might surprise you to know that arrays in Lua start at 1 instead of 0!
😱3
Client vs Customer: A client is the one who wants professional support/service from the company. Whereas, a customer refers to a person who purchases products or services from the company.
#english
👍3
Philocode
Running time #GA
Linked lists are good for inserts/deletes, and arrays are good for random access.
#GA
Okay, let's breath!
👍4