Chandu yadav has Published 1091 Articles

What is the Count property of SortedList class in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 11:02:51

126 Views

Example Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          SortedList s = new SortedList();          s.Add("S1", "Electronics");          s.Add("S2", "Clothing");          s.Add("S3", "Applicances");   ... Read More

How do you empty an array in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 10:52:35

20K+ Views

To empty an array in C#, use the Array Clear() method: The Array.Clear method in C# clears i.e.zeros out all elements.In the below example, we have first considered an array with three elements −int[] arr = new int[] {88, 45, 76};Now we have used the Array.Clear method to zero out ... Read More

What are the different commands used in MySQL?

Chandu yadav

Chandu yadav

Updated on 19-Jun-2020 13:52:18

4K+ Views

SQL language is divided into four types of primary language statements: DML, DDL, DCL and TCL. Using these statements, we can define the structure of a database by creating and altering database objects and we can manipulate data in a table through updates or deletions. We also can control which ... Read More

Reservoir Sampling

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 09:51:21

1K+ Views

The Reservoir sampling is a randomized algorithm. In this algorithm, k items are chosen from a list with n different items.We can solve it by creating an array as a reservoir of size k. Then randomly pick one element from the main list and placed that item in the reservoir ... Read More

Possible walks from a source to a destination with exactly k edges

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 09:36:20

386 Views

A directed graph is given. Another two vertices u and v are also given, u is the starting vertex, and v is the ending vertex. Our task is to find a number of walks from vertex u to v with exactly k edges. The value of k is also provided ... Read More

Babylonian method to find the square root

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 09:20:17

4K+ Views

The Babylonian method to find square root is based on one of the numerical method, which is based on the Newton- Raphson method for solving non-linear equations.The idea is simple, starting from an arbitrary value of x, and y as 1, we can simply get next approximation of root by ... Read More

Secant method to solve non-linear equation

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 08:55:00

1K+ Views

Secant method is also used to solve non-linear equations. This method is similar to the Newton-Raphson method, but here we do not need to find the differentiation of the function f(x). Only using f(x), we can find f’(x) numerically by using Newton’s Divide difference formula. From the Newton-Raphson formula, we ... Read More

Shortest Common Super Sequence

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 08:09:32

262 Views

Shortest common super-sequence is a sequence where each element of both of the given sequences is present. In other words, we can say that the given two strings, both are sub-sequence of Shortest Common Super-Sequence.When there are no common characters in two strings, then we can simply concatenate them to ... Read More

Maximum profit by buying and selling a share at most twice

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 07:07:12

491 Views

In a trading, one buyer buys and sells the shares, at morning and the evening respectively. If at most two transactions are allowed in a day. The second transaction can only start after the first one is completed. If stock prices are given, then find the maximum profit that the ... Read More

Min Cost Path

Chandu yadav

Chandu yadav

Updated on 17-Jun-2020 06:57:58

692 Views

A matrix of the different cost is given. Also, the destination cell is provided. We have to find minimum cost path to reach the destination cell from the starting cell (0, 0).Each cell of the matrix represents the cost to traverse through that cell. From a cell, we cannot move anywhere, ... Read More

Advertisements