Giter Site home page Giter Site logo

Comments (1)

likejazz avatar likejazz commented on June 27, 2024 1

책에는 재귀와 반복 구현 코드가 계속해서 번갈아가며 등장하는데요. 자세히 보시면 둘의 장단점을 어렵지 않게 확인하실 수 있습니다. 재귀를 간단하고 우아하다고 표현한 이유는 일단 코드가 훨씬 더 짧고 무엇보다 빈틈 없이 꽉 짜여 있습니다. 흔히 우리가 더 이상 뺄 것도, 넣을 것도 없는 상태를 완벽하다고 표현하는데요. 이런 코드를 보면 우아하다는 느낌을 받곤하죠. 재귀 코드를 보면 대부분 그렇습니다. 반면, 바꿔 말하면 이 얘기는 추가, 삭제가 쉽지 않다는 얘기이기도 합니다. 심지어 디버깅 코드조차 넣기가 어렵습니다. 따라서, 평소 재귀에 대한 훈련이 많이 되어 있지 않거나 대부분의 보통 사람들은 재귀를 보면 어렵다고 느끼게 됩니다. 사람마다 다르겠으나 실무에서는 혼자서만 개발하는건 아니기 때문게 다른 사람도 이해가 쉽도록 저 또한 꼭 필요한 경우가 아니라면 대부분 반복으로 구현하는 편입니다.

from python-algorithm-interview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.