raVaN

Remove Duplicates from Sorted Array

Problem Statement: (link) Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length. Do not allocate extra space for another array, you must do this by modifying the input array in place with O(1) extra memory. Note that the input array is passed in by reference, which means a modification to the input …

Remove Duplicates from Sorted Array Read More »

Breadth First Search (BFS)

Here, We will discuss about Breadth First Search (BFS), their algorithms and also explain advantages, disadvantages, time complexity and their applications. Graph Traversals Graph traversal means visiting every vertex and edge exactly once in a well-defined order. During a traversal, it is important that you track which vertices have been visited. The most common way …

Breadth First Search (BFS) Read More »

Dynamic Programming

Here, We will discuss about Dynamic Programming, their strategy, properties and approaches like memoization and tabulation and their applications. What is Dynamic Programming? Dynamic Programming is a powerful technique to solve a complicated problem by breaking it down into simpler subproblems. The idea of dynamic programming is to avoid making redundant method calls. In Divide …

Dynamic Programming Read More »

Binary Search

Here, We discuss about Binary Search, their implementation in C, time and space complexity and its applications. What is Binary Search? Binary Search is the most popular searching algorithm. It is efficient and most commonly used to solve problems. The algorithm based on the idea that finding an element’s position in a sorted array. Binary …

Binary Search Read More »

Linear Search

Here, We discuss about Linear Search, their implementation in C, time and space complexity and its applications. What is Linear Search? Linear Search is the simplest searching algorithm. It searches for an element in the list in sequential order. Linear search is used on a collection of items. We start at one end and check …

Linear Search Read More »

Shell Sort

Here, We will discuss about Shell Sort in C, their algorithm, implementation code in C, time and space complexity, and their applications. What is Shell Sort? Shell Sort also called diminishing increment sort. This sorting algorithm is a generalization of insertion sort. Shell sort is efficient for medium size lists. For bigger lists, the algorithm …

Shell Sort Read More »