본문으로 건너뛰기
노리터
여기 사실 휴대폰 커뮤니티임.성지 시세, 알뜰폰 요금 비교표직접 모아 가격순으로 보여줌10-14 확인 · 판매처 55곳 · 요금제 3,344개

자유게시판

아니면 이거좀 해주라

if a recursion call is the last execuable statement in the algorithm, called tail recursion, it can easily be removed using iteration,

tail recursion is so named because the return point of each call is at the end of the algorithm.

thus, there are no executable statements to be executed after each call. to change a tail recursion to an iteration, we use the following steps ;

a) use a variable to replace the procedure call

b) use a loop with limit condition as the base case (or its complement)

c) enclose all executable statements inside the loop

d) change the recursive call to an appropriate assignment statement

e) use appropriate statement to reassign calues to parameters

f) return the value of the variable defined in step a

write the iterative version of the recursion factorial algorithm and test it by printing the value of factorial(5) and fac(20)

문제에 답이 있긴한데

일단 비쥬얼 스튜디오 좀 깔고 올께

수정
신고
진범
Signature

백수

스크랩

댓글 2

  1. 진범

    이건 대충 하겠는데

    write a recuresive algorithm tht finds all occurrenses of a substring in a string

    답글수정
    신고
  2. 진범

    망할 재귀

    답글수정
    신고

댓글 작성

로그인 후 댓글을 작성할 수 있음.로그인

기타 · 파일당 최대 1 MB

자유게시판

번호제목작성자작성일조회추천
4234900연습삼아 앱을 하나 만들어볼라 하는데(12)그분조회228추천0
4234891어제 로또+즉석복권해서 -2500 남이해리조회336추천0
4234888후엉 너무 어렵다진범조회281추천0
42348734259페이지에 최신댓글이(1)pOOhding조회268추천0
4234866시발과제pOOhding조회222추천0
4234863우와pOOhding조회246추천0
4234856영업정지 저축은행(1)이해리조회298추천0
4234841진범때문에 정덕이네(1)그분조회187추천0
4234839안그럼 이거 해볼래?진범조회218추천0
4234823아니면 이거좀 해주라(2)진범조회183추천0
4234805뭔가 심심하다(1)진범조회251추천0
4234788달구이해리조회90추천0
4234782안드레기 어플받기pOOhding조회292추천0
4234758요새 무언갈 먹으러 많이 다녔긴 한데(1)그분조회310추천0
4234756어제 이해리한테 카톡보냈더니(2)연달조회303추천0
4234700근데 비 앰흑이 모야????(2)나하다타조회281추천0
4234697닭 이해리 만나서 뭐했음?(4)그분조회389추천0
4234666천일볶음밥(1)그분조회344추천0
4234661오날 날좋다㉾㉾조회146추천0
4234598식사끗나하다타조회83추천0