כיתה יא - מבנה נתונים - קבוצת יבנה הפעולות של היום (עצים) 24 דצמ 2017 הפעולות בעצים public static void preOrder(BinNode<Integer> t){ if (t != null){ System.out.print(t.getValue()+","); preOrder(t.getLeft()); preOrder(t.getRight()); } } public static void inOrder(BinNode<Integer> t){ if (t !=…
כיתה יא - מבנה נתונים - קבוצת יבנה מיון ברשימה מקושרת 3 דצמ 2017 הפעולה public static BinNode insertToSortedList(BinNode <Integer> p, int num){ BinNode<Integer> tmp = new BinNode<Integer>(num); if (p == null){ return tmp; } if (num < p.getValue()){…
כיתה יא - מבנה נתונים - קבוצת יבנה BinNode 3 דצמ 2017 public class BinNode <T> { private BinNode<T> left; private T value; private BinNode<T> right; public BinNode(BinNode<T> left, T value, BinNode<T> right) { this.left =…
כיתה יא - מבנה נתונים - קבוצת יבנה Queue 19 נוב 2017 המחלקה תור public class Queue <T> { private Node<T> first; private Node<T> last; public Queue(){ this.first = null; this.last = null; }…
כיתה יא - מבנה נתונים - קבוצת יבנה Stack 22 אוק 2017 public class Stack <T>{ private Node<T> head; public Stack(){ this.head = null; } public void push(T x){ Node <T> tmp = new Node<T>(x);…
כיתה יא - מבנה נתונים - קבוצת יבנה הפעולה של מגדלי הנוי 15 אוק 2017 public static void hanoi(int n,char from,char to,char via){ if (n == 1){ System.out.println("move ring from "+from+" to "+to); } else{ hanoi(n-1 ,from,via,to); System.out.println("move ring…
כיתה יא - מבנה נתונים - קבוצת יבנה המחלקה Node הגנרית 11 ספט 2017 המחלקה Node הגנרית public class Node <T> { private T value; private Node<T> next; public Node (T value){ this.value = value; this.next =…
כיתה יא - מבנה נתונים - קבוצת יבנה IntNode ושאר ירקות 11 ספט 2017 הפונקציות מהתוכנית הראשית public static void printList(IntNode p){ while (p != null){ System.out.print(p.getValue()+","); p = p.getNext(); } System.out.println(); } public static int sumList(IntNode p){…