This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Queue() { | |
this.tail = null; | |
this.head = null; | |
} | |
Queue.prototype.enqueue = function(n) { | |
//this.head = n; | |
//n.getNextNode = this.tail; | |
if(this.head == null){ | |
this.head = n; | |
return this.head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var counter = 0; | |
var n = new Node() | |
Stack = function(){ | |
This.top = null; | |
} | |
Stack.prototype.push = function(){ | |
if( this.top == null){ | |
this.top = n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Stack(){ | |
this.top = null; | |
this.length = 0; | |
} | |
Stack.prototype.push = function(n){ | |
//the new node has to be the top so the old top should become the new node's NextNode because it should be second | |
n.setNextNode(this.top); | |
//then you should make the new node the top | |
this.top = n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Queue() { | |
this.tail = null; | |
this.head = null; | |
} | |
Queue.prototype.enqueue = function(n) { | |
if(this.head == null){ | |
this.head = n; | |
this.tail = n; | |
} | |
else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alpha = "abcdefghijklmnopqrstuvwxyz" | |
key = 2 | |
puts "what is your input" | |
name = gets.chomp | |
for i in alpha.split("") | |
c = name.split("")[alpha.index(i)] | |
o = alpha.index(c) | |
m = o + key | |
p = alpha.split("")[m] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "what is your temperature (write degree as C or F)" | |
degree = gets.chomp; | |
if degree.include?("F") | |
degreeC = degree.split("") - ["F"] | |
newDegree = degreeC.join.to_i * 9/5 +32 | |
puts "the Temperature is " + newDegree.to_s + " degrees Celsius" | |
end | |
if degree.include?("C") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Circle { | |
protected int radius; | |
public Circle(int r) { | |
radius = r; | |
} | |
public void setRadius(int r) { | |
r = radius; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Cat extends Pet{ | |
public Cat(String n,int hl, int tl, int cl,int al, String ec) { | |
super(n,hl,tl,cl,al,ec); | |
} | |
public void awesome(){ | |
System.out.println("being more awesome than dog..."); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Browser { | |
private boolean browsing; | |
private WebVisit currentVisit; | |
/** | |
* Main method for the application. Create a new Browser object and set it to run. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Boy extends Man{ | |
public Boy(String n, int a, int s){ | |
super(n,a,s); | |
} | |
} |
OlderNewer