Ladynobug

Basic UF

// Naive implementation of findstatic int find(int parent[], int i) {
if (parent[i] == -1) return i;
return find(parent, parent[i]);
}
// Naive implementation of union()static void Union(int parent[], int x, int y) {
int xset = find(parent, x);
int yset = find(parent, y);
parent[xset] = yset;
}

Compression

public int find(int p) {
if (p != parent[p])
parent[p] = find(parent[p]);
return parent[p];
public void union(int p, int q) {
if (connected(p, q)) return;
for (int i = 0; i < id.length; i++)
if (id[i] == id[p]) id[i] = id[q];
count--;
}

--

--

attribution tracking/marketing

The things that I can think of are

  • affiliate marketing/promo code/unique phone number/unique url, to track the source of sales
  • measure the sales before and after the ads (increased traffic), better to be same time last year.
  • do an online questionnaire or offline selective questionnaire

--

--

Ladynobug

Ladynobug

A growing software engineer. An aspiring entrepreneur. A curious life learner