Skip to content

Instantly share code, notes, and snippets.

View so77id's full-sized avatar
👶
Father in process

Miguel Rodriguez so77id

👶
Father in process
  • Santiago, Chile
View GitHub Profile
@so77id
so77id / VectorExample.java
Created April 17, 2020 22:24
VectorExample
import java.util.Scanner; // Import the Scanner class
import java.util.Vector; // import the ArrayList class
import java.util.Collections;
public class VectorExample {
public static class Pair {
private int first;
private int second;;
@so77id
so77id / Btree.java
Last active April 20, 2020 08:41
Generic Binary Tree
import java.util.Vector;
class Btree<T> {
private Node<T> root;
public Btree() {
this.root = null;
}
public Btree(Node<T> root) {
import java.io.*;
import java.util.*;
public class Solution {
public static class Step {
public int x, y, dist;
public Step(int x, int y, int dist) {
this.x = x;
import java.io.*;
import java.util.*;
public class CopiarPegarBorrarDeshacer {
static public int append(Stack<Character> stack, String buff) {
int count = 0;
for(char c:buff.toCharArray()){
stack.push(c);
count++;
}
// A Java program for Prim's Minimum Spanning Tree (MST) algorithm.
// The program is for adjacency matrix representation of the graph
import java.util.*;
import java.lang.*;
import java.io.*;
class Prim {
// A utility function to find the vertex with minimum key
import java.util.*;
class Dijkstra {
private static int minDistance(int dist[], boolean visited[]) {
// Initialize min value
int min = Integer.MAX_VALUE, min_index = -1;
for (int v = 0; v < dist.length; v++)
import java.util.*;
class TopologicalSort {
public static class Edge{
int u;
int w;
public Edge(int u, int w) {
this.u=u;
this.w=w;
}
import java.io.*;
import java.util.*;
public class Solution {
static class KMP_String_Matching {
public Vector<Integer> KMPSearch(String pat, String txt)
{
Vector<Integer> find_idxs = new Vector<Integer>();
int M = pat.length();
int N = txt.length();
@so77id
so77id / T1-basura.java
Created July 15, 2020 18:05
Soluciones de las Tareas
import java.util.Scanner;
class basura{
public static class Bolsa{
private int Volumen;
Bolsa(int V){
Volumen = V;
}
public void setVol(int V){
@so77id
so77id / List.java
Created September 4, 2020 19:47
Ordered linked list in Java generic
class List<T extends Comparable<T>> {
private Node<T> head;
public List() {
this.head = null;
}
// Insert in Order
public void insert(T value) {
Node<T> n_node = new Node<T>(value);