Skip to content

Instantly share code, notes, and snippets.

View VegaFromLyra's full-sized avatar

Asha Balasubramaniam VegaFromLyra

View GitHub Profile
@VegaFromLyra
VegaFromLyra / InFlightEntertainment
Last active August 29, 2015 14:20
In flight entertainment solution
using System;
using System.Collections.Generic;
namespace InFlightEntertainment
{
public class Program
{
public static void Main(string[] args)
{
test("2", "Yes", areTwoMoviesPresentForFlight(60, new int[]{5, 15, 20, 17, 40, 20}));
@VegaFromLyra
VegaFromLyra / Main.cs
Last active October 7, 2021 13:40
Phone number combinations using Trie
using System;
namespace PhoneCombinations
{
public class Program
{
public static void Main(string[] args)
{
Trie trie = new Trie();
trie.Insert("eat");
@VegaFromLyra
VegaFromLyra / RotationPoint
Last active August 29, 2015 14:21
Rotation point
// https://www.interviewcake.com/question/find-rotation-point?utm_source=weekly_email
using System;
namespace RotationPoint
{
public class Program
{
public static void Main(string[] args)
{
@VegaFromLyra
VegaFromLyra / BipartiteGraph
Created May 21, 2015 16:36
Bipartite Graph
// http://www.geeksforgeeks.org/bipartite-graph/
using System;
using System.Collections.Generic;
namespace BipartiteGraph
{
public enum Color {
NoColor,
Green,
@VegaFromLyra
VegaFromLyra / BST
Last active August 29, 2015 14:21
BST
using System;
using System.Collections.Generic;
namespace BST
{
public class Program
{
public static void Main(string[] args)
{
// BST checker
@VegaFromLyra
VegaFromLyra / LinkedList
Last active August 29, 2015 14:22
Linked list implementation
using System;
namespace LinkedList
{
public class Program
{
public static void Main(string[] args)
{
LinkedList linkedList = new LinkedList();
Console.WriteLine("Add 1 to head");
using System;
namespace HeapSort
{
public class Program
{
public static void Main(string[] args)
{
var input = new int[]{4, 7, 1, 9, 8};
using System;
namespace QuickSort
{
public class Program
{
public static void Main(string[] args)
{
int[] arr = {3, 6, 1, 5, 4};
@VegaFromLyra
VegaFromLyra / Strings
Last active August 29, 2015 14:22
Strings
using System;
using System.Text;
namespace Strings
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("itoa for {0} is {1}", -234, itoa(-234));
@VegaFromLyra
VegaFromLyra / MaxN
Last active August 29, 2015 14:22
Max N numbers
using System;
// Given an array of numbers and a value 'k', find k max numbers from this array
// Time: (n - k) * klogk
// Space: O(1) - Not including the array we allocate for the output
namespace MaxNNumbers
{
public class Program
{