Skip to content

Instantly share code, notes, and snippets.

View navin89's full-sized avatar

Navin Tamilchelvam navin89

View GitHub Profile
@navin89
navin89 / test.ts
Created April 17, 2025 13:57
test
import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
@Component({
selector: 'lib-therapienow-form',
imports: [CommonModule, ReactiveFormsModule],
templateUrl: './therapienow-form.component.html',
styleUrl: './therapienow-form.component.scss',
encapsulation: ViewEncapsulation.None,
@navin89
navin89 / WeightedQuickUnionFind.java
Created December 22, 2016 20:23
Weighted Quick Union Find algorithm (Union-by-Size/Union-by-Height)
public WeightedQuickUnionFind{
private int[] id;
private int[] sz;
private int[] height; // this is for union-by-height
private int count; // the number of connected components
private int[] maximum; // keep track of the maximum object in each connected component
public WeightedQuickUnionFind(int N){
id = new int[N];
sz = new int[N];