Hi , i have problems to learn recurtion

  • Thread starter Thread starter transgalactic
  • Start date Start date
  • Tags Tags
    Hi
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 3K views
transgalactic
Messages
1,386
Reaction score
0
i have this question which are femiliar to the
codes which we learned in class like subsets

but when i try to looks on the subsets code
i can't see the logic of it

how do i understand it??
 
Physics news on Phys.org
Sounds like your are learning recursion and the example you are using is taken from set theory, namely sets and subsets.

Hint: let your recursion terminate on the empty set.

if your function
f(S{})
works on sets, S{},
recognises the empty set {}, and
can find subsets from S{}, then
for every subset Si{} in S{} you can
call f(Si{}).