Coder Social home page Coder Social logo

core-data-structures's People

Contributors

aespaldi avatar avery246813579 avatar dalnk avatar ebonnecab avatar ibirnam avatar neptunius avatar olyve avatar

Watchers

 avatar

core-data-structures's Issues

Feedback on Sets

Your is_subset function uses a repeated variable element. Because of this, it seems that your is_subset will always return True.

Good work with this submission. Your written tests are very good. They test a lot of different cases and check the size property often. I would suggest that you could test more edge cases, like sets with different types of stored data or much larger sets, but otherwise this is good.

Feedback: Linked Lists, Stacks & Queues

  • The tests for the linked list insert_at_index and replace do not pass. insert_at_index seems to handle the base case, but what happens if the node is at the head or tail? In replace, the error never seems to get raised. The error relies on prev_node to be set, but prev_node doesn't seem to get changed in replace. Even if prev_node was correctly set, would it ever trigger the conditional to raise an error?
  • While the stacks and queues implementations work, the LinkedStack is implemented inefficiently. You want to push and pop items at the head of the linked list rather than the tail. While adding to a linked list is O(1) time complexity if at the head or tail, popping at the tail has a time complexity of O(n) for iterating through the linked list and setting the tail node to the second to last node in the linked list. O(1) is possible for popping a LinkedStack.

Feedback on Hash Tables

Good work on this, Ebonne! Your code is passing all tests.

This is not required, but you might consider going back through this class and adding time/space complexity annotations for the remaining methods. Not only will this be a good review, but it will also help deepen your knowledge of how hash tables work.

If you have Pylint installed you might have noticed that it gets upset when you have unused variables. You can replace unused iterating variables with underscores to improve how your code reads.

Your length method could be refactored to just return self.size and drastically improve the runtime.

Feedback on Palindromes and String Searching Algorithms

Good work on getting your palindromes tests passing. The helper function to clean your text is a good idea, but it increases both your time and space complexity before you even check if you have an empty string. Also, it eliminates the possibility of checking early on if the given text is a palindrome and exiting early before altering the string.

The test that is failing in your strings_test.py was not written correctly. Refactor the test and everything should pass. You haven't yet refactored to avoid duplication and you need to annotate your time and space complexities.

Feedback: Number Bases & Search Algorithms

  • Nice work on you number base functions. I would've liked to have seen some comments that explain what some of the lines of code were doing as if I had wasn't familiar with number base conversion (what is the process inside your functions and why is it like that?).
  • Your binary search functions are good as well. I couldn't see anything major that needed fixing; something small that could be fixed is using a linter and to enforce consistent styles. My Flake8 linter was catching some inconsistent styling like the space between midpoint and the minus sign on line 79, and the space between the commas and left on line 80.

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.