Git Product home page Git Product logo

four-semesters-of-cs's Introduction

four-semesters-of-cs's People

Contributors

1marc avatar btholt avatar marshallbu avatar odran037 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

four-semesters-of-cs's Issues

free Introduction to Algorithms

Dear Brian, I'm the textbook manager at the MIT Press, and I received a query from a customer looking for the free edition of Introduction to Algorithms that you mention here. This book is not freely available within copyright. Can you revise your wording so we don't frustrate readers by leading them to believe that this book is freely available? Thank you for your support of Introduction to Algorithms. Michelle Pullano, Textbook Manager, the MIT Press, [email protected]

Big O for Linked List delete

First, thank you for creating this course, Brian. I didn't realize how much I would enjoy the study of algorithms and recursion.

Second, I have a question regarding the Big O for Linked Lists, specifically for deletes. On line 429 of the course materials, you say that "LinkedList's adds and deletes are O(1) but the gets are O(n)". However, the delete method we implemented uses the _find method (if we are not deleting the head), which contains a loop. Would this not mean that delete is also (usually) O(n)? Building on that, would this also mean that the LinkedList is really only optimized for adds?

Looking at the Big O cheatsheet, they describe a singly linked list as having O(n) for access and search, while having O(1) for insertion and deletion, so I know I must be misunderstanding something. Could you provide a little more explanation behind this? I would greatly appreciate it šŸ˜„

Insertion Sort Algorithm codepen example is O(nĀ²) for worst AND best case

Please correct me if I am wrong, but I believe the Insertion Sort algorithm on codepen is O(nĀ²) regardless if the array is mostly sorted or not. This can be observed by the fact that if you pass in a completely sorted array, there are still 45 comparisons made. This can also be observed by the fact that it is as performant as an optimized Bubble Sort. Also, as I understand, Array.splice is an O(n) operation and should be avoided if possible. This is a little nit-picky, but I believe it might come up during coding interviews.

Here is my implementation, which is O(n) when the array is mostly sorted. I am sure there is a cleaner way to write it than my implementation, however.

Suggested book no longer free

The link to Introduction to Algorithms leads to a page where we can buy the book in various formats or rent the book for a fee. It seems there's no free version. I suggest updating the text or possibly linking to an older, free version of it if there is one available.

Bubble sort algorithm optimization

Hi Brian, loved your courses on Frontend masters. I was looking at the solution you provided for bubble sort. While it looks good and readable, I feel the solution bubbles the largest element to the end but considers all the elements in every loop instead of leaving the bubbled elements which is kind of the purpose of bubble sort. We can reduce the time by half if we ignore the bubbled elements.

I have modified your solution by adding an index that is maintained to ignore the bubbled elements.

const bubbleSort = nums => {
  let swapped = false;
  let index = 0;

  do {
    swapped = false;
    for (let i = 0; i < nums.length - index; i++) {
      if (nums[i] > nums[i+1]) {
        let temp = nums[i];
        nums[i] = nums[i+1];
        nums[i+1] = temp;
	swapped = true;
      }
    }
    index++;
 } while(swapped)
 console.log(nums);
};

`snapshot()` not working in code pens

Sorry if the Front End Masters guys bug you about this, I mentioned it to them not realizing you'd asked for issues and PRs.

The snapshot method that let's you visualize the sorts as you work on them seems not to be defined in the codepens.

Is there a missing dependency, or something else going on?

AVL tree

In the section concerning AVL trees, I would replace the sentence "move node B's right child to its left child" with "move node B's left child to its right child".

What do you think ?

-> move node B's right child to its left child

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.