Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Basic_Concepts/Scope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Scope

According [Wikipedia](https://en.wikipedia.org/wiki/Variable_%28computer_science%29#Scope_and_extent):
According [Wikipedia](https://en.wikipedia.org/wiki/Variable_%28computer_science%29#Scope_and_extent):

*"Scope is an important part of the name resolution of a variable. Most languages define a specific scope for each variable (as well as any other named entity), which may differ within a given program. The scope of a variable is the portion of the program code for which the variable's name has meaning and for which the variable is said to be "visible"."*


Expand Down
76 changes: 71 additions & 5 deletions Data_Structures/Arrays/Basics/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,81 @@
![](http://i.imgur.com/BgUMUGU.png)

# Course description, (maybe title of the lesson instead of course description.)
This MD file serves as example/template. It will be filled up soon.
# Arrays - Bascis
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:

(for Bucky to fill up)
Array_name[0] = the value of the first place



# Course Documentation

(this for me to fill up with every element that you use in lessons. syntax explaination and links for more)

## Element to explain
## Arrays

Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:

Array_name[0] = the value of the first place

According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*

Now in our example:

var food = ['bacon', 'corn', 'ham', 'sausage'];

We see the initiation through the typical aray syntax:


var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]

The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
For example to access the 5th element of an array we are typing:

arrayname[4]

In our example we used few statments that we should explain bit further:

**Push and Pop**
Push adds new item to the end of an array

(for example console.log)
food.push('tuna');
console.log(food);

while pop removes and item from the end of an array.

var lastItem = food.pop();
console.log(lastItem);
console.log(food);
For both Push and Pop please feel free to check bellow about stacks.

**Simple Iteration**
The way to iterate elements in javascript arrays is pretty straight forward:

console.log(food[2]);

Array values are retrieved by index (starting at 0 not 1).

Iteration through loop
The best way to iterate an array is mathematically through a loop, like the example bellow:

// you can iterate over an array to access each individual element
for(var i=0; i<food.length; i++){
console.log(i, food[i]);
}

The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
[JavaScript Arrays (w3Schools)](http://www.w3schools.com/js/js_arrays.asp)
## Stacks

A stack is a data structure that can be logically thought of as a real physical stack or pile, a structure where
insertion and deletion of items takes place at one end only called the "top" of the stack. The basic concept can be
illustrated by thinking of your data set as a stack of plates or books where you can only take the top item off the
stack in order to remove things from it.

![](http://i.imgur.com/dax54C9.jpg)

##Javascript functions

Expand Down Expand Up @@ -57,4 +121,6 @@ Inside the function, the arguments behave as local variables.
- [Twitter](https://twitter.com/bucky_roberts)
- [Google+](https://plus.google.com/+BuckyRoberts)
- [reddit](https://www.reddit.com/r/thenewboston/)


> Written with [StackEdit](https://stackedit.io/).