Giter Site home page Giter Site logo

cs-2.1-trees-sorting's People

Contributors

neptunius avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cs-2.1-trees-sorting's Issues

Feedback on sorting algorithms

What was great:

  • Good job on implementing your is_sorting function efficiently!
  • Good job on successfully implementing your sorting algorithms!
    Here's some feedback to improve:
  • Try adding a couple more test cases as specified by the TODO's!
  • Merge sort algorithms need to be in place! That's the reason the unit tests are failing :(

Feedback on prefix trees

Great job on completing the prefix tree!

  • You can further challenge yourself by working on time and space complexities for each prefix tree method. You would be expected to do this in interviews, and it would be good practice :)
  • Your complete method is failing. It seems to add different combinations of the words in the prefix tree, which is not valid. Ex. If apple is in the tree, then apple is valid but pplea is not.

Feedback on heaps, priority queues, and integer sorting algorithms

Great work on completing these challenges. Here's some feedback to improve your code:

  • Your priority queue does not work as expected. Your front, push_pop, and dequeue functions should return the actual item! So if I inserted “apple” with priority 0, the item is “apple”. Don't return the whole tuple. I tried running your code by these tests:
if __name__ == "__main__":
    PQ = PriorityQueue()
    assert(PQ.is_empty())
    assert(PQ.length() == 0)
    PQ.enqueue("apple", 2)
    assert(PQ.length() == 1)
    assert(PQ.front() == "apple")
    assert(PQ.length() == 1)
    PQ.enqueue("orange", 0)
    assert(PQ.length() == 2)
    assert(PQ.front() == "orange")
    assert(PQ.length() == 2)
    assert(PQ.dequeue() == "orange")
    assert(PQ.length() == 1)
    assert(PQ.push_pop("banana", 4) == "apple")
    assert(PQ.length() == 1)
    assert(PQ.front() == "banana")
    assert(PQ.length() == 1)
    print("PASSED")

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.