Binary Search is one of the methods of searching an item in a list of items.Here we will look into how to implement binary search in C#. We first need to calculate the middle element in the list and then compare the element we are searching with this middle element. To calculate middle element we […]
Archives for April 2020
Find pattern in a String using Python
First declare the main text text=”abcd” #this is main text Noe declare the pattern you want to search in the main text patt=”cd” #this is pattern to search for in the main text Now find the difference in length of main text and pattern #first calcualte the difference between main text and pattern diff=len(text)-len(patt) print(diff) […]
Understanding Azure function
azure function is a way to implement serverless computing in azure.This means that the developer is not concerned about things such as managing infrastrcuture,scalling and deployment.Instead developer can focus on business logic. Function is executed when an action occurs.Here action is the event which triggers the function.That is why you need to defined the trigger […]
Run ASP.NET Core application in a docker container
Containers are similar to virtual machines.But they have the following advantages when compared to virtual machines:- They are lightweight since all the containers share the same OS. They have faster start up time. Docker is one of the most popular containerization technologies.Docker can run on different OS such as Windows,Linux and Mac. We can run […]
Finding substring in a string
Following program finds a substring in a string. public static int Find(string text, string pattern) { // ASHI COMPARE A,S,H,I // SHI A==S,S==H for (int i = 0; i <=text.Length – pattern.Length; i++) { int temp = i; for (int j = 0; j < pattern.Length; j++) { temp++; if (text[temp] == pattern[j]) { j++; […]