Skip to content

ahmedmohamedreda/Learn-Data_Structure-Algorithm-by-Javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Learn Data Structure and Algorithms by JavaScript

You need to have basic understanding of the JavaScript programming language to proceed with the codes from this repository.

Table of Contents


Introduction

JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that you can have the same variable as different types:

var foo = 42;    // foo is now a Number
var foo = 'bar'; // foo is now a String
var foo = true;  // foo is now a Boolean

Data Types in JavaScript

The latest ECMAScript standard defines seven data types:

  • Six data types that are primitives:

    • Boolean (true and false)
    • Null (invalid object or address has the value null)
    • Undefined (a variable that has not been assigned a value has the value undefined)
    • Number (integer and floating point values ranging from -(253 -1) to (253 -1), +Infinity, -Infinity and NaN(not-a-number) )
    • String (Sequence of textual characters. Strings are immutable in JavaScript)
    • Symbol (new in ECMAScript 6)
  • Object

Arrays

JavaScript Arrays are regular objects for which there is a particular relationship between integer-key-ed properties and the 'length' property. Additionally, arrays inherit from Array.prototype which provides to them a handful of convenient methods to manipulate arrays like indexOf (searching a value in the array) or push (adding an element to the array), etc. This makes arrays a perfect candidate to represent lists or sets.

More details about data types in JavaScript:

Object Oriented Programming in JavaScript

Big-O Cheat Sheet

Big-O Cheat Sheet Link

How to Use

The easiest way to run and test the codes from this repository is to use nodejs (I have checked my code using nodejs v6.5.0 in an Windows machine).

Install it in your machine and add it to your environment path so that it is accessible in terminal commands.

Then you can run a JavaScript file like this:

node file.js

Useful Links:

About

Data Structure and Algorithm explanations with Implementations by Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%