C# Code Samples

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Xml;

namespace MyJobSearchPrograms
{
class Program
{
static void Main(string[] args)
{
//display(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });
//findFirstRepeatedCharacter();
//Console.WriteLine(findFirstDuplicateEfficient("find nfoul"));
//findTwoMaxRepeatedCharactersEfficient("aaabaaabaaabaaa");
//removeDuplicateWhiteSpaceEfficient("This is my book ");
//countMaxRepeatedCharacters();
//SwapInt(5, 4);
//SwapChar('s', 'm');
//swapNumber();
//changeCaseOfString("RakeSH");
//convertLowerToUpperEfficient("RakeSH");
//checkPalaindrome("taxatt");
//reverseWords("This is my book");
//reverseWordsEfficient("This is my book");
//Console.WriteLine(reverseString("This is my book"));
//isPartOfString("This is my book", "my");
//Console.WriteLine(removeSampleString("Thiis iiis my iiiis book issfr;", "iiis"));
//printWordsFromEnd("This is not my book");
//printWordsFromEndEfficient("This is not my book");
//printMaxRepeatedWord();
//printMaxRepeatedWordEfficient("mama& dad, boy! girl! boy? girl? boy$");
//countDuplicateArrayElements(new int[] { 1, 2, 2, 2, 6, 6, 6, 2, 3, 4, 5, 5, 7, 7, 2, 5, 4, 5 });
//removeDuplicateSortedArray(new int[] { 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5 });
//printDuplicatefromUnsortedArray(new int[] { 1, 1, 2, 3, 4, 4, 5, 6, 6,6,6 });
//printDuplicateSortedArrayEfficient(new int[] { 1,2,2,2,2,2,2,2,3, 4, 4, 5, 5, 5, 5, 5, 5,6,6,6,6,6,6,7 });
//removeDuplicateFromSortedArrayEfficient(new int[] { 1, 2, 2, 3, 3, 3, 3, 4, 5, 6, 6, 6, 6, 7});
//countDuplicateUsingHashable(new int[] { 1, 2, 8, 2, 2, 6, 6, 6, 2, 3, 4, 5, 5, 7, 9, 7, 2, 5, 4, 5 });
//removeDuplicateUsingBucket(new int[] { 0, 2, 2, 2, 0, 6, 6, 2, 5, 5, 7, 0, 7, 2, 5, 4, 5, 9 });
//Console.WriteLine(fibonaci(10));
//Console.WriteLine(checkFibbonaciOrNot(5));
//displayFibbonaci(20);
//isPrime(13);
//Console.WriteLine(IsPrime(13));
//Console.WriteLine("Int value = {0}",convertStringToInt("-123"));
//Console.WriteLine("Int value = {0}",convertStringToIntEfficient("-12345"));
//convertIntToString(-135);
//convertIntToBinary(6);
//findTwoMaximumNumbers(new int[] { 12, 1, 6, 7, 9, 1, 2, 8, 20, 5 });
//findThreeMaximumNumbers(new int[] { 7, 15, 6, 7, 9, 1, 2, 8, -1, 50 });
//Console.WriteLine(Int32.Parse(integerReverse(12345)));
//Console.WriteLine(reverseInteger(12345));

//int[] leftrotatedarr = SortedArrayRotationRight(new int[]{1,2,3,4,5}, 1);
//Console.WriteLine("Number Of Rotation :{0}", findSortedArrayRightRotationValue(leftrotatedarr));
//int[] rightrotatedarr = SortedArrayRotationLeft(new int[] { 1, 2, 3, 4, 5 }, 1);
//Console.WriteLine("Number Of Rotation :{0}", findSortedArrayLeftRotationValue(rightrotatedarr));
//shiftArrayElementRight(2, new int[] { 1, 2, 3, 4, 5 });
//shiftArrayElementEfficient(-2, new int[] { 1, 2, 3, 4, 5 });
binarySearch(6, new int[] { 0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
//angleBetweenHourAndMinute(12, 15);
//findOneRepeatedArrayElements(new int[] {-1,-1,3,2,3,4,4,4,5,5,6}); //only for positive values;
//findOneRepeatedArrayElements("abcdefghababc");
//reverseStringPlusOne("abc");
//displayPerfectNumber();
//checkTriangle(2, 3, 4); checkTriangle(5, 6, 5); checkTriangle(3, 3, 3); checkTriangle(-1, 2, -7);
//sumInArray("123abc456abc789", "abc");
//sumGroupInArray("111abc111abc1111", "abc");
//changeMillisecondToStandardTime(666666666);

//printDateDifference("10-16-2008", "10-1-2008");
//txtFileReading();
//deleteFromHarddiskFolder();
//ReadXMLContent();

}

//implement the coding functios


}

No comments:

Post a Comment