TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
CODING LIKE A PRO

19 Oct 2021, 19:47

Open in Telegram Share Report

0-10255439827_20211018_213137_0000.pdf
960.1Kb
Google search result suggestions may show that "Recursion is bad" or "Recursion is magic" but the actual reason why many programmers have problem with recursion is because the call stack is invisible. Recursion should be used either while navigating through tree-like structures or when the problem requires backtracking.

A stack is a data structure that holds a sequence of data and only lets you interact with the top most item. A recursive function call pushes a frame object into stack and returning the method pops them off.

A stack overflow is when a recursive function gets out of control and doesn't stop. Recursion programs can be implemented with loop and stacks.

Recursion is usually slower than iteration due to the overhead of maintaining the stack. Recursion uses more memory than iteration.

Recursion has very high (generally exponential) time complexity whereas loops have relatively lower time complexity (generally polynomial-logarithmic).
🤩 6
😁 3
👍 8
👎 6
Instagram

1.4k 0 0
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot