Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. import unit4.collectionsLib.*;
  2.  
  3. public class aa
  4. {
  5. public static Stack<Integer> CopyS(Stack<Integer> S) // שכפול מכסנית
  6. {
  7. Stack<Integer> S1 = new Stack<Integer>();
  8. Stack<Integer> S2 = new Stack<Integer>();
  9.  
  10. while (!S.isEmpty())
  11. S1.push(S.pop());
  12. while (!S1.isEmpty())
  13. {
  14. int k = S1.pop();
  15. S.push(k);
  16. S2.push(k);
  17.  
  18. }
  19. return S2;
  20. }
  21.  
  22. public static Queue<Integer> CopyQ(Queue<Integer> Q)// שכפול תור
  23. {
  24. Queue<Integer> Q1 = new Queue<Integer>();
  25. Queue<Integer> Q2 = new Queue<Integer>();
  26.  
  27. while (!Q.isEmpty())
  28. Q1.insert(Q.remove());
  29. while (!Q1.isEmpty())
  30. {
  31. int a = Q1.remove();
  32. Q.insert(a);
  33. Q2.insert(a);
  34. }
  35. return Q2;
  36. }
  37.  
  38. public static int SizeS(Stack<Integer> S)// אורך מחסנית
  39. {
  40. int i = 0;
  41. Stack<Integer> S1 = new Stack<Integer>();
  42. while (!S.isEmpty())
  43. {
  44. S1.push(S.pop());
  45. i++;
  46. }
  47. while (!S1.isEmpty())
  48. S.push(S1.pop());
  49. return i;
  50.  
  51. }
  52. public static Stack<Integer> OrganizeS(Stack<Integer> S)// מיון מחסנית קטן
  53. // למטה גדול למעלה
  54. {
  55.  
  56. }
  57. public static int MaxS(Stack<Integer> S)// ערך מקסימלי במחסנית
  58. {
  59.  
  60. }
  61. public static int MinS(Stack<Integer> S)// ערך מינימלי במחסנית
  62. {
  63.  
  64. }
  65. public static Stack<Integer>[]S_values_qu(Stack<Integer> S)// פעולה שמקבלת מחסנית ומחזירה ערכים וכמויות בשתי מחסניות
  66. {
  67. Stack<Integer>[] AR= new Stack[2];
  68. }
  69. public static Stack<Integer> SwitchS(Stack<Integer> S)//הםיכת מחסנית
  70. {
  71.  
  72. }
  73. public static boolean CheckS(Stack<Integer> S , int x)// האם X נמצא במחסנית
  74. {
  75.  
  76. }
  77. public static int CheckTS (Stack<Integer> S , int a)// כמה פעמים A במחסנית
  78. {
  79.  
  80. }
  81. public static boolean CompareS (Stack<Integer> S , Stack<Integer> S1)//השוואת מחסניות מוחלטת
  82. {
  83.  
  84. }
  85. public static boolean SameNum (Stack<Integer> S , Stack<Integer> S1)//האם יש אותם מספרים
  86. {
  87.  
  88. }
  89.  
  90.  
  91.  
  92.  
  93.  
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement