סריקה לרוחב של עץ

public static void HorizentalScan(BinNode<Integer> t) {       Queue<BinNode<Integer>> q = new Queue<BinNode<Integer>>();       BinNode<Integer> tmp;      q.insert(t);      while (!q.isEmpty()) {            tmp = q.remove();            System.out.print(tmp.getValue()+",");            if (tmp.hasLeft()) {                  q.insert(tmp.getLeft());            }            if (tmp.hasRight())…

הפונקציות של היום 07.09.2025

public static void printList(Node<Integer> lst) {                 while (lst != null) {                                 System.out.print(lst.getValue()+ " --> ");                                 lst = lst.getNext();                 }                 System.out.println("null"); }                 public static Node<Integer>…