MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / add

Method add

src/class152/FollowUp1.java:68–74  ·  view source on GitHub ↗
(int num)

Source from the content-addressed store, hash-verified

66 }
67
68 public static void add(int num) {
69 split(0, 0, head, num);
70 key[++cnt] = num;
71 size[cnt] = 1;
72 priority[cnt] = Math.random();
73 head = merge(merge(right[0], cnt), left[0]);
74 }
75
76 public static void remove(int num) {
77 split(0, 0, head, num);

Callers 1

mainMethod · 0.95

Calls 3

splitMethod · 0.95
mergeMethod · 0.95
randomMethod · 0.45

Tested by

no test coverage detected