Giter Site home page Giter Site logo

dsa-training's People

Contributors

minhduc9699 avatar

dsa-training's Issues

Thừa biến

Ở trong bài BTree, hàm find()

https://github.com/minhduc9699/DSA-Training/blob/master/btree.py#L49

Biến found sinh ra là không cần vì em không dùng nó vào việc gì cả.
Nếu nói là dùng vào việc kết thúc vòng lặp cũng không đúng vì ngay sau khi để found = True với ý đồ thoát vòng lặp, khi biến này chưa kịp phát huy tác dụng ở vòng lặp tiếp theo, thì đã có return. Khi chương trình gặp return, thì có nghĩa là cả hàm được thoát ra, bao gồm vòng lặp rồi

Suy nghĩ về chuyện chia thành 2 hàm

https://github.com/minhduc9699/DSA-Training/blob/master/btree.py#L36

Ở đoạn này anh hiểu là em định xử lý 2 trường hợp khác nhau, chia thành 1 cái cho trường hợp không có root, và 1 cái thì có root. tuy nhiên khi bóc thành 2 hàm, lại cùng tên, thường chỉ có 2 trường hợp .�Một là hàm con (i.e. _add) là hàm đệ quy, có tham số đầu vào rất khác với hàm gốc (i.e. `add). Hai là hàm gốc dài và bao gồm các bước cụ thể, bước 1 làm gì, bước 2 làm gì, thì nên tách ra thành các hàm con với tên các hàm là tên các bước tương ứng

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.