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; | |
using System.Threading.Tasks; | |
namespace Yield | |
{ | |
class Program | |
{ | |
//This is not real code only an example | |
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
using System; | |
using System.Collections.Generic; | |
namespace Yield | |
{ | |
class Program | |
{ | |
//This is not real code only an example | |
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
using System; | |
using System.Collections.Generic; | |
namespace Yield | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
foreach (var number in GetNumbers()) |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
foreach (var i in FizzBuzz(100)) | |
{ | |
Console.WriteLine(i); | |
} | |
} |
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
static void GetBinarySearchRecursive() | |
{ | |
var list = new[] { 2, 3, 4, 5, 6, 7, 8, 9, 11, 23, 44, 66, 77, 88, 99, 101, 102, 104, 170, 344, 445, 565, 673, 733, 874, 912, 1001, 1120 }; | |
int searchTerm = 102; | |
int start = 0; | |
int end = list.Length; | |
var RecordNo = BinarySearchRecursive(ref list, start, end, searchTerm); | |
if (RecordNo == -1) |
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
static void BinarySearch() | |
{ | |
// sort array | |
var list = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 23, 44, 66, 77, 88, 99, 101, 102, 104, 170, 344, 445, 565, 673, 733, 874, 912, 1001, 1120 }; | |
var searchTerm = 9999; | |
int result = -1; //assume is all postive numbers | |
var start = 0; | |
var end = list.Length; | |
int RecordPosition = -1; |
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
static void Union() | |
{ | |
int[] first = new[] { 1, 2, 3, 4, 6, 7, 7, 8, 8, 75, 4, 4, 3, 3, 3, 3, 4, 56, 6, 7, 7, 6, 4, 3, 2, 35, 56, 56, 56, 5, 77 }; | |
int[] second = new[] { 1, 3, 5 }; | |
List<int> InBoth = new List<int>(); | |
for(var i = 0; i< first.Length; i++) | |
{ | |
for(var v =0; v<second.Length; v++) | |
{ |
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
// Manual Distinct using C# | |
// Used List<int> to make it easier to read | |
static void Distinct() | |
{ | |
int[] allList = new[] { 1, 2, 3, 4, 6, 7, 7, 8, 8, 75, 4, 4, 3, 3, 3, 3, 4, 56, 6, 7, 7, 6, 4, 3, 2, 35, 56, 56, 56, 5, 77 }; | |
List<int> distinct = new List<int>(); | |
foreach(var i in allList) |
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
#!/bin/sh | |
# this script installs various stuff to help run YARN stuff on windows 10 | |
# Developed as could not run "yarn add @fesk/scripts --dev" due to issues with shebangs #! | |
# First install Windows subsystem on Windows 10 | |
# Install Ubuntu 18.X | |
# Need Root privs to run this. | |
# sudo -i |