Ejemplo n.º 1
0
		// 2. How do you find the duplicate number on a given integer array? (solution)
		void Question2(int[] arr)
		{
			var h = new HelperFunctions();
			h.ArrayPrinter(arr); 
			h.ArrayAscendingSorter(arr);
			h.ArrayPrinter(arr);
			h.DuplicateFinder(arr);
		}
Ejemplo n.º 2
0
		// 1. How do you find the missing number in a given integer array of 1 to 100? (solution)
		void Question1(int[] arr)
		{
			Console.WriteLine("Hello World!");
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			h.ArrayAscendingSorter(arr);
			// Since arrays are passed by value, 
			// the array doesn't need to be passed around
			h.ArrayPrinter(arr);
			h.FindMissingNumberFromSortedArray(arr);
		}
Ejemplo n.º 3
0
		// 4. How do you find all pairs of an integer array whose sum is equal to a given number? (solution)
		void Question4(int[] arr)
		{
			var givenNumber = 5;
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			h.SumEqualsGivenNumberPairFinder(givenNumber, arr);
		}
Ejemplo n.º 4
0
		// 3. How do you find the largest and smallest number in an unsorted integer array? (solution)
		void Question3(int[] arr)
		{
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			h.LargestNumberPrinter(arr);
			h.SmallestNumberPrinter(arr);
		}
Ejemplo n.º 5
0
		// 6. How are duplicates removed from a given array? (solution)
		void Question6(int[] arr)
		{
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			h.DuplicateRemover(arr);
		}
Ejemplo n.º 6
0
		// 10. How are duplicates removed from an array without using any library? (solution)
		void Question10(int[] arr)
		{
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			// TODO: 
		}
Ejemplo n.º 7
0
		// 7. How is an integer array sorted in place using the quicksort algorithm? (solution)
		void Question7(int[] arr)
		{
			var h = new HelperFunctions();
			h.ArrayPrinter(arr);
			// TODO: Solution link C# https://www.w3resource.com/csharp-exercises/searching-and-sorting-algorithm/searching-and-sorting-algorithm-exercise-9.php
		}