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

Method prepare

src/class164/Code07_Peaks1.java:83–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81 }
82
83 public static void prepare() {
84 for (int i = 1; i <= n; i++) {
85 sorted[i] = node[i];
86 }
87 Arrays.sort(sorted, 1, n + 1);
88 s = 1;
89 for (int i = 2; i <= n; i++) {
90 if (sorted[s] != sorted[i]) {
91 sorted[++s] = sorted[i];
92 }
93 }
94 for (int i = 1; i <= n; i++) {
95 node[i] = kth(node[i]);
96 }
97 }
98
99 public static void addEdge(int u, int v) {
100 next[++cntg] = head[u];

Callers 1

mainMethod · 0.95

Calls 2

kthMethod · 0.95
sortMethod · 0.45

Tested by

no test coverage detected