This file contains hidden or 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
void Main() | |
{ | |
var firstNode1 = new ListNode(1); | |
var firstNode2 = new ListNode(3); | |
var firstNode3 = new ListNode(5); | |
var firstNode4 = new ListNode(7); | |
var firstNode5 = new ListNode(9); | |
firstNode1.next = firstNode2; | |
firstNode2.next = firstNode3; | |
firstNode3.next = firstNode4; |
This file contains hidden or 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
void Main() | |
{ | |
var firstNode1 = new ListNode(1); | |
var firstNode2 = new ListNode(3); | |
var firstNode3 = new ListNode(5); | |
var firstNode4 = new ListNode(7); | |
var firstNode5 = new ListNode(9); | |
firstNode1.next = firstNode2; | |
firstNode2.next = firstNode3; | |
firstNode3.next = firstNode4; |
This file contains hidden or 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
void Main() | |
{ | |
LinkedList linkedList1 = new LinkedList(); | |
linkedList1.push(1); | |
linkedList1.push(3); | |
linkedList1.push(5); | |
linkedList1.push(7); | |
linkedList1.push(9); | |
LinkedList linkedList2 = new LinkedList(); |
This file contains hidden or 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
void Main() | |
{ | |
LinkedList linkedList = new LinkedList(); | |
linkedList.push(20); | |
linkedList.push(4); | |
linkedList.push(15); | |
linkedList.push(10); | |
Console.WriteLine(linkedList.DetectCycleVersion2(linkedList.head)); | |
/*Create loop for testing */ | |
linkedList.head.Next.Next.Next.Next = linkedList.head; |
This file contains hidden or 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
void Main() | |
{ | |
List<int> numbers = new List<int> {8,7,6,5,6,6,6,6,6,2,8,7,6,5,6,6}; | |
int number = numbers.GetMajorityNumber(); | |
Console.WriteLine($@"The Majority Number is {number}"); | |
} | |
/// <summary> | |
/// Given an unsorted array which has a number in the majority | |
/// (a number appears more than 50% in the array), find that number? |
This file contains hidden or 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
void Main() | |
{ | |
Console.WriteLine(Person.FullName); | |
Person.FullName.FormateName( | |
s => | |
{ | |
string outS = ""; | |
foreach (var c in s) | |
{ |
This file contains hidden or 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
void Main() | |
{ | |
IReactiveList<ExplorerTitleBarItem> ExplorerTitleBarItems; | |
ExplorerTitleBarItems = new ReactiveList<ExplorerTitleBarItem>() | |
{ | |
new ExplorerTitleBarItem("Documnet Viewer"), | |
new ExplorerTitleBarItem("Bookmarks"), | |
new ExplorerTitleBarItem("Clipboard") | |
}; |
This file contains hidden or 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
void Main() | |
{ | |
var matrix1 = new[] { | |
new Matrix { Row = "0", Column = "0", Value = 1 }, | |
new Matrix { Row = "1", Column = "1", Value = 2 } | |
}; | |
var matrix2 = new[] { | |
new Matrix { Row = "0", Column = "0", Value = 1 }, | |
new Matrix { Row = "1", Column = "1", Value = 2 } |
This file contains hidden or 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
public class BusySpinner | |
{ | |
private Brush brush; | |
public Canvas BusySpinnerCanvas { get;} | |
private DispatcherTimer animationTimer; | |
const int Steps = 16; | |
public BusySpinner(Brush brush) | |
{ | |
this.brush = brush; |