Embedded Academy
3.96K subscribers
794 photos
118 videos
241 files
248 links
📢 All About Embedded in Persian and English

Embedded Systems
IoT
AI
Machie Vision

در سایر شبکه ها:
aparat.com/embedded
instagram.com/embedded_ir
Twitter.com/embedded_ir

Admin: @embeded
Download Telegram
Embedded Academy
مقایسه الگوریتم‌های مرتب سازی 👈 این نمودارها نشان می‌دهد که #دانش چگونه می‌تواند سرعت را افزایش و هزینه را کاهش دهد. 🔸 در این نمودارها داده‌ها بر اساس الگوریتم‌های مختلف (Insertion، selection، bubble، ...) مرتب‌سازی می‌شوند که از جمله فرآیندهای مهم و پایه‌ای…
📚 grokking algorithms
📖 An illustrated guide for
programmers and other curious people

✏️Aditya Y. Bhargava

This book uses Visualization technique to teach algorithms in an easy way for understanding and keeping in mind for programmers.

آگاهی از الگوریتم خصوصا در برنامه‌نویسی سیستم‌های نهفته و آشنایی با شیوه محاسبه پیچیدگی ضروری‌است. الگوریتم و مباحثی نظیر محاسبه هزینه و پیچیدگی از جمله مباحثی است که بسیاری از متخصصان و فعالین این حوزه که عمدتا از رشته‌های برق و الکترونیک هستند در دانشگاه درس مرتبط نگذارنده‌اند.

#Algorithms
@embedded
Embedded Academy
🔺Comparision of C++ and Posix Threads ✍️ B4b4k What is the difference between using the C++ std threads and POSIX threads? API: The API for C++ std threads and POSIX threads are different, with different function names and parameters. The C++ std thread…
One line down, more efficient: Tail Recursion

📌 B4b4k

Recursive functions are known for programmers, but it uses the call stack and has stack overflow risk. but simple change results in a big difference. this change is called "tail recursive". The tail recursion is that kind of recursion in which the recursive call is made at the end of the function.
Consider this formal recursion:

unsigned int fact(unsigned int n)
{
if (n <= 0)
return 1;
return n * fact(n - 1);
}

Can Change to the Tail-recursion version as follows:
unsigned int factTail(unsigned int n, unsigned int a)
{
if (n == 1)
return a;
return factTail(n - 1, n * a);
}
unsigned int fact(unsigned int n) { return factTail(n, 1); }

Note in this version there is no statement after the recursive call.
While computers execute recursive with the help of stacks By using tail recursive instead of formal or head recursive, compilers (such as GCC) can transform this to loop and eliminates stack overflow risk and decrease space complexity from O(n) to O(1).

#Tips #Algorithms #Cpp
@embedded