Aditya Chatterjee's Blog, page 147
November 6, 2021
Types of Dimensionality Reduction Techniques
In this article, we will learn Why is Dimensionality Reduction important and 5 different Types of Dimensionality Reduction Techniques like Principal Component Analysis, Missing Value Ratio, Random Forest, Backward Elimination and Forward Selection.
Table of Contents:
IntroductionWhat is Dimensionality?What is Dimensionality Reduction?Why do we need Dimensionality Reduction?Types of Dimensionality Reduction Techniques5.1. Principal Component Analysis
5.2. Missing Value Ratio
5.3. Random For...
November 5, 2021
Get current stock price in Python
In this article, we have covered how to get the current stock price in Python from Yahoo Finance using two Python libraries, Beautiful Soup, and the Requests library.
Table of contents:
Basics of Yahoo FinanceInstall the libraries neededImport the packagesUse Requests to send an HTTP request to Yahoo Finance websiteUse Beautiful Soup to parse the contentInspect the page to retrieve the stock dataThe full code is at the end of the article at OpenGenus.
Yahoo FinanceYahoo Finance (finance...
Maximum String Partition problem: Partition Labels
In this article, we have explored approaches to solve the maximum string partition problem (Partition Labels) efficiently.
Table of contentsProblem statementBrute Force approachLogic for Efficient ApproachEfficient AlgorithmFinal codeThis is similar to Leetcode problem 763. Partition Labels.
Problem StatementGiven a string of alphabets, partition the string in maximum number of parts such that each letter appears in only one part. Output the number of partition and size of partitions.
S...November 4, 2021
Alien Dictionary problem: Sorted order of characters
In this article, we are given a sorted list of words in some alien dictionary. Based on the list, we have to generate the sorted order of characters in that alphabet. This problem can be solved using the idea of Topological Sort and Direct Acyclic Graphs. So, let's begin!
Table of contents:
Understanding Topological SortAlien Dictionary ProblemWhat we are supposed to doOur approachPrerequisite: Topological Sort
This is similar to Leetcode problem 269. Alien Dictionary.
Understanding Topolo...Shortest Superstring problem
Hey Guys 🎉, in this article, we have explained three approaches to solve the Shortest Superstring problem. This involve concepts like DFS and Dynamic Programming.
Table of contents:
Problem StatementApproach 1: Brute-Force (Back-Tracking)Approach 2: Search + Pre-CompilingApproach 3: Dynamic ProgrammingThis is similar to Leetcode problem 943. Find the Shortest Superstring.
Problem StatementLet's discuss a hard yet very intresting problem named "Shortest SuperString Problem".
The problem st...
Swap Nodes in Pairs

In this article, we have explained an efficient approach to Swap adjacent nodes in a Singly Linked List inplace. We have presented both Iterative and Recursive implementation.
Table of contents:
Problem StatementApproachIllustrationIterative SolutionRecursive SolutionThis is similar to Leetcode Problem 24. Swap Nodes in Pairs.
Problem StatementWe’re given the pointer to the head of a singly linked list, we're asked to reverse each two adjacent nodes and return the pointer/reference to th...
All O`one Data Structure
In this post, we will design a Data Structure that returns the string occurring maximum and minimum times in constant time O(1). This will use a hashmap and a doubly linked list utilizing the advantages of each to solve the problem.
Table of contents:
Problem StatementNaive Approach (Using a 2D doubly linked list)Optimized approach (Using hash map and doubly-linked list)Time & Space Complexity AnalysisTo attempt similar problems on Designing Data Structure, go to this list.
This is simila...
Substring with Concatenation of All Words
In this article, we have explained two approaches to solve the problem Substring with Concatenation of All Words. This involves the idea of Hash Map and Two Pointer.
Table of ContentsProblem StatementApproach 1: Hash MapApproach 2: Two pointerComparison of methodsThis is similar to Leetcode Problem 30. Substring with Concatenation of All Words.
Problem StatementLet's say that we are given a list of strings L of N strings, and a string S. We need to find the substrings in S which are a co...
Time & Space Complexity of Heap Sort
In this article, we have explained Time & Space Complexity of Heap Sort with detailed analysis of different cases like Worst case, Best case and Average Case.
Table of contents:
Overview of Heap SortTime complexity of Heap Data StructureWorst Case Time Complexity of Heap SortBest Case Time Complexity of Heap SortAverage Case Time Complexity of Heap SortSpace Complexity of Heap SortConclusionPrerequisite: Heap Sort, Heap Data Structure
Let us get started with Time & Space Complexity of H...
Rotate Image: matrix of size NxN by 90 degrees (clockwise)
In this article, we have explored an efficient way to Rotate Image: matrix of size NxN by 90 degrees (clockwise) inplace by using a property of XOR operation.
Table ContentsIntroductionAlgorithmCode in C++ and ImplementationFinal considerationsPrerequisite: Bitwise operations, Applications of XOR operation
This is similar to Leetcode problem 48. Rotate Image.
1. IntroductionRotation is part of Geometric Transformations, along with translation and scale.
translation is related to the ele...