This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace PhoneCombinations | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Trie trie = new Trie(); | |
trie.Insert("eat"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.geeksforgeeks.org/bipartite-graph/ | |
using System; | |
using System.Collections.Generic; | |
namespace BipartiteGraph | |
{ | |
public enum Color { | |
NoColor, | |
Green, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace BST | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
// BST checker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace LinkedList | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
LinkedList linkedList = new LinkedList(); | |
Console.WriteLine("Add 1 to head"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace HeapSort | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var input = new int[]{4, 7, 1, 9, 8}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace QuickSort | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
int[] arr = {3, 6, 1, 5, 4}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
{ |
OlderNewer