Articles for author: Deepa Pandey

Permutation of String

Problem Statement In this article we are going to discuss a variant of the Permutation of String. The problem statement goes like this, you will be given two strings, say s1 and s2. And, we need to find a substring in s2 that is a permutation of string s1. What is the Permutation of a String? The permutation of string is the set of ...

Introduction to Logarithms

Overview In this article, we are going to learn about Logarithms in programming. Before getting started with the topic, let us get a short overview of what is Logarithms. Logarithms: In mathematics, the inverse of an exponential function is called the logarithmic function. In simple terms, the logarithm is the exponent or power of any ...

Word Break Problem

Problem Statement In the word break problem, you will be given a string, say s, and a dictionary of strings say wordDict. The wordDict will contain several strings. Now, our job is to determine if we can break or segment the string using the words in the dictionary. If we can do that, then we return a True, otherwise, ...

Job Sequencing Problem

Problem Statement You are given a set of N jobs, where each job is having a deadline and a profit associated with it. You can only earn a profit if you complete the job within its given deadline. You can perform the job either before the deadline or strictly on the deadline, not after that. Rules: Input Format: The jobs will be ...

Analysis of Algorithm

An algorithm is a step-by-step set of instructions, which are meaningful and used to solve any particular problem. To perform every process, there is a set of Algorithms, which lets us know how to proceed with the problem and solve it in some steps. The analysis of an algorithm is a technique that measures the performance of an ...

Sorting Algorithms

Sorting refers to the process of arranging a list or a sequence of given elements(that can be numbers or strings, etc.) or data into any particular order, which may be ascending or descending.Sorting is basically useful whenever we want our data to be in an ordered form. To make our lives easier, we have sorting ...

Stable Sorting Algorithm

A sorting algorithm is a process of reorganizing the elements in a meaningful order. Sorting Algorithms help us to reorganize a large number of items into some specific order such as highest to lowest, or vice-versa, or even in some alphabetical order. They take some input, perform some operations over them and return a sorted ...

Recursion and Backtracking

Recursion and Backtracking are important problem solving approaches. Recursion may also be called as the alternative to our regular iterative approach of solving any problem. Recursion provides us with an elegant way to solve complex problems, by breaking them down into smaller problems and with fewer lines of code than iteration. However, not every recursive ...

Traversal of Binary Tree

Before jumping into the traversal of binary tree algorithms, let’s define a Tree as a data structure first. That will help you to grasp the concepts in a more meaningful way. The tree is a hierarchical data structure that is defined as a collection of nodes. In a tree, nodes represent the values and are ...