Skip to content

Instantly share code, notes, and snippets.

View ashwath10110's full-sized avatar

Ashwath Bharadwaj ashwath10110

View GitHub Profile
@ashwath10110
ashwath10110 / TRIE.cs
Last active November 5, 2015 18:42
Simple Trie Datastructure in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programming.Data_Structures.Trie
{
public static class TrieExtension
{
public static int AlphabetSize = 26;
@ashwath10110
ashwath10110 / unionfind.cs
Created November 5, 2015 18:24
Simple Union-Find Datastructure in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programming.Data_Structures.Union_Find
{
public class UF
{
public int[] id { get; set; }
@ashwath10110
ashwath10110 / UnweightedUndirected.cs
Created November 5, 2015 18:27
Simple Unweighted Undirected in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programming.Data_Structures
{
public class Graph
{
public readonly int _V;
@ashwath10110
ashwath10110 / DirectedEdge.cs
Created November 5, 2015 18:29
Simple Weighted and Directed Graph in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programming.WeightedDirected
{
public class EdgeWeightedDigraph
{
private readonly int _v;
@ashwath10110
ashwath10110 / Edge.cs
Created November 5, 2015 18:31
Simple Weighted Undirected graph in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Programming.WeightedUndirected
{
public class Edge : IComparable<Edge>
{
@ashwath10110
ashwath10110 / DP.txt
Created November 5, 2015 18:34
Dynamic Programming funtions Using bottom up approach C#
static int[] p = { 1, 5, 8, 9, 10, 17, 17, 20 };
static int N = p.Length;
static int[,] cache = new int[N, N];
static int[] mem = new int[N + 1];
public static int Max(int a, int b)
{
return a > b ? a : b;
}
@ashwath10110
ashwath10110 / LRU.cs
Created November 5, 2015 18:38
Simple LRU Cache using Queue and Dictionary in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS
{
public class LRU
{
@ashwath10110
ashwath10110 / backtracking.cs
Created November 5, 2015 18:45
Simple Backtracking C#
public class RatInMaze
{
public int[,] board;
public int[,] sol;
public int desx;
public int desy;
public int N { get; set; }