GithubHelp home page GithubHelp logo

cs-1.3's People

Watchers

 avatar

cs-1.3's Issues

Some feedback on sets

Great progress in the course so far! Here’s some feedback on sets to help improve your code~

  • Remember to pass in all of the required arguments (ex. max_size) when initializing a class object. Check your methods in Set for how you are creating sets, using Set(). Did you pass in max_size?
  • When you call class methods, remember to use self.name_of_method() to call it! Otherwise, it will be undefined.
  • Making note of time and space complexities is best practice. You will be asked to do this in interviews. I recommend doing so for your set functions :)

Feedback on the second submission

  • Your imports don’t work! Make sure your tests pass before submitting. I recommend having modules in the same file, or look into why the imports are not working. (A lot of strange import errors with all of the files!)
  • You are facing a logical error in your sets class! When you initialize a new set inside your union/intersection/other functions, you are not passing in any parameters. However, your Set class requires a max_size to be specified upon initialization! Either make that optional, or use it. This might have all your tests pass if the functions are implemented correctly. :)
  • Your set class should also allow users to have the “option” of adding a list of items during initialization —> s = Set(5, [“apple”, “orange”]).
  • Your set should not have a limit for how many elements can be added. It can use max size to initialize/resize the underlying hash table, but you should be able to add as many elements as you want, unless that element already exists (no duplicates). Look over your add method.

Feedback on First Submission

Great job on working on the challenges! Here are a couple of improvements you can make for full credit:

  • Strings
    • Refactoring: Contains, find_index, and find_all_indexes all have a lot of overlapping code. Think about how you can break this apart into helper functions OR implement functions by calling one of the required functions, such that there is no repeated code in your file.
    • Add a couple of unit tests for better testing! It is easier than you would think. Look through the unit test file Alan gave, and use that pattern to call your functions on some edge case inputs.
    • Annotate your functions for time and space complexity. What’s the big O? How much space are you using (Are you initializing a new list, new variables, etc.)?
  • LinkedList length method: Although this is not required, it would be good to think about how you can improve the time complexity of this function, now that you have a size property that tracks the number of elements in your list. Can it be faster?
  • LinkedList insert at index and replace methods currently do not pass all unit tests. Try to debug, use print statements, to see what's going on.

Feel free to come to office hours or reach out if you need help with any of these!

Feedback on the third submission

  • You need got publish your blog post for full credit! Its a great article —> just publish it!
  • Call Routing Project: You benchmarked time complexity for only one of the solutions. Do this for both solutions for the extra point. In addition, this will allow you to compare which solution works better! I also recommend having your second scenario also output the solution in a text file, since it is a LOT of print statements in the terminal.

Feedback on Strings.py (First Submission)

  • Strings: refactor your code such that there is no duplicate code in the file. Is there a way you could use 1 of the three functions and use them in the other two for the same result? Or use a helper function?
  • I see that you annotated for time complexity. Do the same for space complexity. How much space is your function using? Are you allocating any arrays, sets, dictionaries, etc?

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.