Linear search is used for searching an item in a list of items,such as in Array.It is not efficient when compared to other ways of searching item in an array. public static int LinearSearch(int[] A,int val) { for(int i=0;i<A.Length;i++) { if(A[i]==val) return i; } return-1; } We can sort items in the array before calling […]
Archives for May 2020
Find non repeating characters in a string using LINQ
Commonly we need to find the characters in a string which are not repeated or which occurs only once.We can use the following LINQ example to find such characters. Though this is a short string but you can see that even in this string all characters are repeated except M,L and O. We first iterate […]
Overview of Azure Functions
Azure functions are used to isolated small pieces of logic.These functions are triggered when some triggering even happens. Azure fucntions is a Serverless computing technology Azure functions can be created using C#,Typescript and many different technologies Azure functions are based on triggers,events and isolated code. Events cause trigger to fire which causes the function to […]
Check if a string is palindrome in C#
Here we will be checking if a string is palindrome.To check if string is palindrome we need to know the occurrence of each character.Every character should occur even number of times.This is except the case when the length of the string is not even.So for example if the length of the string is 5 then […]