-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
139 lines (66 loc) · 2.89 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
namespace DataStructuresAndAlgos
{
class Program
{
static void Main(string[] args)
{
//Problem1.RunTests();
//Problem2.RunTests();
//Problem3.RunTests();
//Problem4.RunTests();
//Problem5.RunTests();
//Problem6.RunTests();
//Problem7.RunTests();
//Problem7.PrintLeaders(new int[] { 4, 3, 1, 2 });
//Problem8.RunTests();
//Assignment4.Problem9.RunTests();
//Problem10.RunTests();
//Problem10.PrintByFreq(new int[] { 9, 4, 5, 7, 5, 5, 9 });
//Assignment5.Problem1.RunTests();
//BSTDemo.Run();
//ClockAngleDemo.Run();
//Assignment5.Problem6.RunTests();
//Assignment5.Problem5.RunInteractiveTesting();
//Assignment5.Problem2.RunInteractiveTesting();
//Assignment5.Problem3.RunInteractiveTesting();
//Assignment5.Problem4.RunInteractiveTesting();
//Assignment6.Problem7.RunTests();
//Assignment6.Problem4.RunTests();
//Assignment6.Problem1.RunTests();
//Assignment6.Problem2.RunTests();
//Assignment6.Problem3.RunTests();
//RelatedPractice.LCS.RunTests();
//Assignment6.Problem5.RunTests();
//Assignment6.Problem6.RunTests();
//Assignment6.Problem8.RunTests();
//Assignment6.Problem10.RunInteractiveTesting();
//Assignment6.Problem9.RunTests();
//RelatedPractice.LinkedListDemo.RunDemo();
//RelatedPractice.PrinterDemo.InteractivePrinterDemo();
//Assignment7.Problem3.RunTests();
//Assignment7.Problem8.RunTests();
HackerRank.SampleTest.RunTests();
// looks like there's no copy constructor for Array
// have to allocate first then copy
//var arr = new int[] { };
//IEnumerable<int> ie = arr;
// int.MaxValue == 2 billion and change
// long.MaxValue == 9 quintillion, etc.
// About four billion int.MaxValue would fit in a long.MaxValue
// 9223372036854775807 / 2147483647 == 4 billion and change
// If you are overflowing the long type, you are doing something wrong??
//var dict = new Dictionary<int, int>() { { 2, 2}, { 5, 2}, { 8, 3}, { 6, 1} };
//IEnumerable<KeyValuePair<int, int>> dictIE = dict;
//foreach (var kvp in dictIE)
//{
// Console.WriteLine($"{kvp.Value}");
//}
//Console.WriteLine("\n\n");
//var descendingByValue = dict.OrderByDescending(i => i.Value);
//foreach (var kvp in descendingByValue)
//{
// Console.WriteLine($"{kvp.Value}");
//}
}
}
}