Skip to content

Instantly share code, notes, and snippets.

View Bjacksonshorts's full-sized avatar

Bjacksonshorts

View GitHub Profile
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;
var counter = 0;
var n = new Node()
Stack = function(){
This.top = null;
}
Stack.prototype.push = function(){
if( this.top == null){
this.top = n;
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;
function Queue() {
this.tail = null;
this.head = null;
}
Queue.prototype.enqueue = function(n) {
if(this.head == null){
this.head = n;
this.tail = n;
}
else{
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]
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")
public class Circle {
protected int radius;
public Circle(int r) {
radius = r;
}
public void setRadius(int r) {
r = radius;
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...");
}
}
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.
*/
public class Boy extends Man{
public Boy(String n, int a, int s){
super(n,a,s);
}
}