Here is the code:
class Solution {
Merge two sorted arrays to one array in C#
Here is the code:
public static int[] Merge(int[] nums1, int[] nums2)
public static int[] Merge(int[] nums1, int[] nums2)
Binary search algorithm with recursion in C#
Here is the code:
public int Search(int[] nums, int target) {
public int Search(int[] nums, int target) {
Binary search algorithm without recursion in C#
Here is the Code:
public int Search(int[] nums, int target) {
int s=0;
public int Search(int[] nums, int target) {
int s=0;
Rotate Array to K places in C#
Given an array, rotate the array to the right by k steps, where k is non-negative.
Example 1:
Input: [1,2,3,4,5,6,7] and k = 3
Optimal Maximum distance traveled problem
Given max travel distance, forward and backwards routes, return the routes which utilizes maximum travel distance.
Example:
Forward route : [[1,3000],[2,5000],[3,4000],[4,10000],[5,8000]]
Backward route : [[1,1000],[2,3000],[3,4000]]
Max Distance Traveled: 11000
Example:
Forward route : [[1,3000],[2,5000],[3,4000],[4,10000],[5,8000]]
Backward route : [[1,1000],[2,3000],[3,4000]]
Max Distance Traveled: 11000
Check if path exists between two nodes in a graph using Breadth first search (BFS)
Here is the code:
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
Check if path exists between two nodes in a graph using Depth first search (DFS)
Here is the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication75
{
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication75
{
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
Breadth first search (BFS) Levels implementation in C#
Here is the code:
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
node r1 = new node(1);
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
node r1 = new node(1);
Breadth first search (BFS) Graphs implementation in C#
Here is the code:
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
Depth First Search (DFS) Graphs implmentation in C#
Here is the Code:
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
class Program
{
static List<int> li = new List<int>();
static void Main(string[] args)
{
node r0 = new node(0);
How to create a Quene data structure in C#
Here is the Code:
class Program
{
static void Main(string[] args)
{
Quene q = new Quene();
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
q.add(1);
class Program
{
static void Main(string[] args)
{
Quene q = new Quene();
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
q.add(1);
How to create Stack data structure in C# with Push() and Pop() functions
Here is the Code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
stack s = new stack();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
stack s = new stack();
Function to Sort elements of a Linked List in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Function to Display elements of the LinkedList from Kth integer in C#
Here is Code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Function to Display elements of Linked List in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Function to Remove Middle element of Linked List in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Function to Reverse Linked List in C#
Here is the Code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Function to remove an item from Linked List in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
LinkedList l = new LinkedList();
Sorting collection of Integers using Quick Sort Algorithm
Here is the code:
class Program
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
static void Main(string[] args)
{
int[] a1 = new int[] { 5, 3, 5, 2, 1, 0, 8, 10, 9, 20, 32 };
class Program
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
static void Main(string[] args)
{
int[] a1 = new int[] { 5, 3, 5, 2, 1, 0, 8, 10, 9, 20, 32 };
How to Print Bottom View of a Binary Tree.
Here is the Code:
class Program
{
static void Main(string[] args)
{
class Program
{
static void Main(string[] args)
{
How to Print Left view of a Binary tree
Here is the code:
class Program
{
static void Main(string[] args)
{
class Program
{
static void Main(string[] args)
{
How to Print Spiral Order of a Binary Tree in C#
Here is the Code:
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
BSTnode n = new BSTnode(5);
class Program
{
static void Main(string[] args)
{
// This Solution is written by me and is not completely tested. Please comment if you found any alternative solutions or any enhancement to my solution.
BSTnode n = new BSTnode(5);
How to remove duplicates from a string in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
Console.WriteLine(RemoveDuplicates("ajayreddy tutorials"));
class Program
{
static void Main(string[] args)
{
Console.WriteLine(RemoveDuplicates("ajayreddy tutorials"));
How to check if two Binary trees are identical or not in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
BSTnode n = new BSTnode(5);
class Program
{
static void Main(string[] args)
{
BSTnode n = new BSTnode(5);
How to Display Binary Search Tree Nodes data level by level in C#
Here is the code:
class Program
{
static void Main(string[] args)
{
BSTnode n = new BSTnode(5);
n.add(2);
n.add(7);
n.add(3);
n.add(1);
n.add(6);
n.add(8);
displayBST(n);
}
public static void displayBST(BSTnode n)
{
class Program
{
static void Main(string[] args)
{
BSTnode n = new BSTnode(5);
n.add(2);
n.add(7);
n.add(3);
n.add(1);
n.add(6);
n.add(8);
displayBST(n);
}
public static void displayBST(BSTnode n)
{
How to create Binary Search Tree in C#
Binary Search tree is a collection of nodes where each node has a left node and right node. To Satisfy binary search tree all the left nodes data must be less than root nodes and all the right nodes data must be greater than root nodes.
Here is the code to create BST in C#:
class Program
{
Here is the code to create BST in C#:
class Program
{
How to create Linked List in C#
Linked List a data structure which the collection of nodes where each node contains data and link to next node.
Below code show how to create a linked list:
//Node class
public class node
{
Below code show how to create a linked list:
//Node class
public class node
{
Popular Posts
-
Here is the code: // => Brute Force Solution: O(m* n) static long arrayManipulation(int n, int[][] queries) { ...
-
Whatever it is one fine day everyone on this planet who are born have to die for sure. When you are close ones are with you, you wont know ...
-
HTML: <div class="outer-container"> <div class="inner-container"> <div class="t...