2013-04-11 01:07:29 -07:00
|
|
|
function Stack() {
|
|
|
|
|
this.data = new Array();
|
|
|
|
|
|
|
|
|
|
this.push = function(element) {this.data.push(element)}
|
|
|
|
|
this.pop = function() {return this.data.pop()}
|
|
|
|
|
this.empty = function() {return this.data.length == 0}
|
2015-02-20 00:35:01 -05:00
|
|
|
this.peek = function() {return this.data[this.data.length - 1]}
|
2013-04-11 01:07:29 -07:00
|
|
|
}
|