A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/zonayedpca/AlgoDS.js below:

zonayedpca/AlgoDS.js: 🛠🛠🛠 Widely used Algorithms and Data Structures using JavaScript 🛠🛠🛠

JavaScript Algorithm And Data Structure

This is an attempt to implement all kind of widely used Algorithms and Data Structures in the programming world using JavaScript. Thus the term AlgoDS is used as a name of this repository. Anyone can use it as a reference to implement those problems. If you have any suggestion, then please make an issue or contact me, I will be grateful to you.

Most of the implementations are done using pure functions so that anyone can use them as well if they want. index.js files are made for testing purpose. Besides, you will find README file in every problem that will illustrate the problem so that you can understand them easily.

It allows us to calculate how the runtime of an Algorithm grows as the inputs grow

Describe the performance of an algorithm. How much processing power or time is required to run an algorithm if we double the amount of input

       O(n^2)
|       / / O(nlogn)/ O(n)
|      / /        /
|     / /       /
|    / /      /
|   / /     /
|  / /    /
| / /   /
|/ /  /----------------------- log(n)
| / /_________________________ O(1)
|//___________________________
Identifying Runtime Complexity

The amount of space in the memory required by that particular Algorithm. How much more memory is required by doubling the problem set.

123 => 321 => n times
123456 => 654321 n times
Some Mostly Used Space Complexity

Logarithmic values often can be very confusing. But there also very easy to understand. Like if we explain what does log2(8) = 3 means:

log2(8) = 3
=> 2^3 = 8
log(2)(value) = exponent => 2^exponent = value

And also log2 and log is same. We can omit 2 in this case

We can analyze the JavaScript's built-in objects to find out its various complexity to accomplish various task

const anObj = {
  name: 'Zonayed Ahmed',
  age: 22,
  gender: 'Male'
}

We can analyze the performance of JavaScript's built-in array

const anArr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 1000]

Some problem solving patterns are widely used to simplify the solution like:

This pattern uses objects or sets to collect values/frequency of values. Thus most of time nested loops or O(n^2) time complexity can be avoided

Creating pointers or values that correspond to an ndex or position and move towards beginning, end or middle based on a certain condition

Ways of organizing information with optimal runtime complexity for adding, removing and some basic operations in the record. Some example of mostly used Data Structure


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4