Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import unit4.collectionsLib.*;
- public class aa
- {
- public static Stack<Integer> CopyS(Stack<Integer> S) // שכפול מכסנית
- {
- Stack<Integer> S1 = new Stack<Integer>();
- Stack<Integer> S2 = new Stack<Integer>();
- while (!S.isEmpty())
- S1.push(S.pop());
- while (!S1.isEmpty())
- {
- int k = S1.pop();
- S.push(k);
- S2.push(k);
- }
- return S2;
- }
- public static Queue<Integer> CopyQ(Queue<Integer> Q)// שכפול תור
- {
- Queue<Integer> Q1 = new Queue<Integer>();
- Queue<Integer> Q2 = new Queue<Integer>();
- while (!Q.isEmpty())
- Q1.insert(Q.remove());
- while (!Q1.isEmpty())
- {
- int a = Q1.remove();
- Q.insert(a);
- Q2.insert(a);
- }
- return Q2;
- }
- public static int SizeS(Stack<Integer> S)// אורך מחסנית
- {
- int i = 0;
- Stack<Integer> S1 = new Stack<Integer>();
- while (!S.isEmpty())
- {
- S1.push(S.pop());
- i++;
- }
- while (!S1.isEmpty())
- S.push(S1.pop());
- return i;
- }
- public static Stack<Integer> OrganizeS(Stack<Integer> S)// מיון מחסנית קטן
- // למטה גדול למעלה
- {
- }
- public static int MaxS(Stack<Integer> S)// ערך מקסימלי במחסנית
- {
- }
- public static int MinS(Stack<Integer> S)// ערך מינימלי במחסנית
- {
- }
- public static Stack<Integer>[]S_values_qu(Stack<Integer> S)// פעולה שמקבלת מחסנית ומחזירה ערכים וכמויות בשתי מחסניות
- {
- Stack<Integer>[] AR= new Stack[2];
- }
- public static Stack<Integer> SwitchS(Stack<Integer> S)//הםיכת מחסנית
- {
- }
- public static boolean CheckS(Stack<Integer> S , int x)// האם X נמצא במחסנית
- {
- }
- public static int CheckTS (Stack<Integer> S , int a)// כמה פעמים A במחסנית
- {
- }
- public static boolean CompareS (Stack<Integer> S , Stack<Integer> S1)//השוואת מחסניות מוחלטת
- {
- }
- public static boolean SameNum (Stack<Integer> S , Stack<Integer> S1)//האם יש אותם מספרים
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement