Advertisement
Guest User

Updated javascript array operation

a guest
Jan 22nd, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. Updated javascript array operation
  2. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  3.  
  4. Download Here ►►► http://www.fl-y.com/download-here
  5. Download Here ►►► http://www.fl-y.com/download-here
  6. Download Here ►►► http://www.fl-y.com/download-here
  7.  
  8. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  9.  
  10.  
  11. int[] lewa = new int[array.Length / 2];
  12. int[] prawa = new int[array.Length / 2];
  13. if (array.Length > 1)
  14. {
  15. lewa = array.Take(array.Length / 2).ToArray();
  16. prawa = array.Skip(array.Length / 2).ToArray();
  17. Sortowanie(lewa);
  18. Sortowanie(prawa);
  19. }
  20. int i, j, k;
  21. i = j = k = 0;
  22. while((i<lewa.Length) && j <( prawa.Length))
  23. {
  24. if (lewa[i] < prawa[j])
  25. {
  26. array[k] = lewa[i];
  27. i++;
  28. }
  29. else
  30. {
  31. array[k] = prawa[j];
  32. j++;
  33. }
  34. k++;
  35. }
  36. while (i < lewa.Length)
  37. {
  38. array[k] = lewa[i];
  39. i++;
  40. k++;
  41. }
  42. while (j < prawa.Length)
  43. {
  44. array[k] = prawa[j];
  45. j++;
  46. k++;
  47. }
  48. return array;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement