I have troubles with this code ..!
I started to work with eclipse last week.. And i don have any idea what to do with this code,.. In data Structures And Algorithms.. :( Help Me.. !
this is the code
public class MyQueue {
int n = 5;
int[] a = new int[n];
int h = 0;
int t = 0;
public boolean isEmpty()
{
}
public int first()
{
}
public int size()
{
}
public void pushBack(int e)
{
}
public void popFront()
{
}
public void print()
{
System.out.println("------------------------------------------------------------------");
System.out.println("| h \t| t \t| a[0]\t| a[1]\t| a[2]\t| a[3]\t| a[4]\t| size() |");
System.out.println("-------------------------------------------------------------------");
System.out.print("| " + h + "\t| " + t +"\t|");
for(int i=0; i<a.length; i++){
System.out.print(" "+a[i]+ "\t");
}
System.out.println("| "+size()+ "\t|");
System.out.println("-------------------------------------------------------------------\n");
}
public static void main(String[] args)
{
MyQueue q = new MyQueue();
q.pushBack(5);
q.print();
//-----------------
q.pushBack(2);
q.print();
q.pushBack(1);
q.print();
q.pushBack(7);
q.print();
q.pushBack(6);
q.print();
//----------------
q.popFront();
q.print();
q.popFront();
q.print();
q.pushBack(8);
q.print();
q.pushBack(9);
q.print();
}
}