Files
unisa_strutture_dati_2013_2014/esercizi/start.java

70 lines
1.4 KiB
Java

package esercizi;
/**
* Created with MONSTER.
* User: xgiovio
* Date: 13/04/2014
* Time: 22:18
*/
public class start {
public static void main(String[] args) {
System.out.println(static_methods.inverti("ehila"));
System.out.println(static_methods.checkParentheses("[()()()]([])"));
System.out.println (static_methods.isPalindrome("a"));
///////////// test squeue
SQueue<Integer> a = new SQueue<Integer>();
a.enqueue(5);
a.enqueue(10);
a.enqueue(20);
a.enqueue(30);
a.enqueue(40);
System.out.println (a);
System.out.println (a.front());
System.out.println (a.dequeue());
System.out.println (a);
a.enqueue(60);
System.out.println (a);
System.out.println (a.front());
System.out.println (static_methods.extract(a,0));
///////////// end test squeue
QStack<Integer> b = new QStack<Integer>();
b.push(1);
b.push(2);
b.push(3);
b.push(4);
System.out.println (b);
System.out.println (b.top());
System.out.println (b.top());
System.out.println (b.pop());
System.out.println (b);
System.out.println (b.top());
System.out.println (a);
System.out.println (static_methods.isContained(a,115));
System.out.println (a);
}
}