Skip to content

jakearmijo/data-structures-and-algorithms

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Common Data Structures and Algorithms

Creating and exploring the common data structures and algorithms
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

![Common Data Structures and Algorithms][screenshot]

I started this to build common data structures and practice algorithims. This is a place I am keeping notes and documentation on topics. What is an algorithm? A process or set of steps to acomplish a certain task Foundation for being a successful problem solving and developing

How to improve? Plans and Approaches

Sliding Window

Sliding Window The Sliding Window pattern is used to perform a required operation on a specific window size of a given array or linked list, such as finding the longest subarray containing all 1s. Sliding Windows start from the 1st element and keep shifting right by one element and adjust the length of the window according to the problem that you are solving. In some cases, the window size remains constant and in other cases the sizes grows or shrinks.

Following are some ways you can identify that the given problem might require a sliding window:

  • The problem input is a linear data structure such as a linked list, array, or string
  • You’re asked to find the longest/shortest substring, subarray, or a desired value

Common problems you use the sliding window pattern with:

  • Maximum sum subarray of size ‘K’ (easy)
  • Longest substring with ‘K’ distinct characters (medium)
  • String anagrams (hard)

Two Pointers or Iterators

Two Pointers or Iterators Two Pointers is a pattern where two pointers iterate through the data structure in tandem until one or both of the pointers hit a certain condition.Two Pointers is often useful when searching pairs in a sorted array or linked list; for example, when you have to compare each element of an array to its other elements.

Two pointers are needed because with just pointer, you would have to continually loop back through the array to find the answer. This back and forth with a single iterator is inefficient for time and space complexity — a concept referred to as asymptotic analysis. While the brute force or naive solution with 1 pointer would work, it will produce something along the lines of O(n²). In many cases, two pointers can help you find a solution with better space or runtime complexity.

Frequency Counter

This pattern uses object or sets to collect values/frequencies of values. This is an idea of creating a object and tracking values we come accross. We can then give them a value and increase or decrease it as needed.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm
    npm install npm@latest -g

Installation

  1. Clone the repo
    git clone https://github.com/jakearmijo/data-structures-and-algorithms.git
  2. Install NPM packages
    npm install

Usage

to study, learn, and beyond

For more examples, please refer to the Documentation

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Questions

Array


Binary


Dynamic Programming


Graph


Interval


Linked List


Matrix


String


Tree


Heap

Important Link:

14 Patterns to Ace Any Coding Interview Question

Acknowledgements

About

Common data structures and algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published