Aditya Chatterjee's Blog, page 66

November 2, 2022

BST to greater sum tree

In this article, we will be discussing about the problem "BST to greater sum tree" in detail. This involve the concept of inorder traversal.

Contents:

IntroductionOptimized approachImplementationCode ExplanationTime and Space Complexity AnalysisIntroduction:

In this problem at OpenGenus, we are given a BST, and we have to transform key of every node of that BST into a greater sum tree where key of every node should be replaced by the sum of all keys greater than key of that node.

Note:
A ...

 •  0 comments  •  flag
Share on Twitter
Published on November 02, 2022 00:06

November 1, 2022

Minimum distance between two given nodes of Binary Tree

In this article, we will be discussing about the problem "Minimum distance between two given nodes of a Binary Tree" in detail. This involve the concept of lowest common ancestor.

Contents:

IntroductionOptimized approachImplementationCode ExplanationTime and Space Complexity AnalysisIntroduction:

In this problem at OpenGenus, we are going to find the minimum distance between two given nodes of a given binary tree. The distance between two nodes is the minimum number of edges to be travell...

 •  0 comments  •  flag
Share on Twitter
Published on November 01, 2022 23:59

Connect Nodes at Same Level in Binary Tree

In this article, we will be discussing about the problem "Connect Nodes at Same Level in a Binary Tree" in detail. This involve the concept of Breadth First Search (BFS) or Level Order Traversal.

Contents:

IntroductionOptimized approachImplementationCode ExplanationTime and Space Complexity AnalysisIntroduction:

In this problem at OpenGenus, we are going to connect the nodes at same level in a binary tree. we'll be given an addition nextRight pointer for the same and we have to connect al...

 •  0 comments  •  flag
Share on Twitter
Published on November 01, 2022 23:57

Extreme nodes in alternate order

In this article, we will be discussing about the problem "Extreme nodes in alternate order in a Binary tree" in detail. This involve the concept of Breadth First Search (BFS) and Level order traversal.

Contents:

IntroductionOptimized approachImplementationCode ExplanationTime and Space Complexity AnalysisIntroduction:

In this problem at OpenGenus, we are going to print the extreme nodes at each level but in the alternate order in a binary tree i.e, in the first level we'll print the left-...

 •  0 comments  •  flag
Share on Twitter
Published on November 01, 2022 23:10

October 31, 2022

Car Pooling Problem

In this article, we have explored the Car Pooling Problem in depth and presented an efficient approach to solve it using the concept of Prefix Sum.

Table of contents:

Problem StatementConstraintsExample Test CasesExplanation of Example 1Prefix SumAlgorithm for Car pooling problemCode for Car pooling ProblemCode ExplanationTime ComplexitySpace ComplexityAnother Approach: Complexity O(N^2)ConclusionProblem Statement:

There is a car with capacity empty seats. The vehicle only drives e...

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 23:26

Dependency inversion principle

In this article, we have explored the concept of Dependency inversion principle in Code Design and explained the concept with an example of Payment System.

Table of content

IntroductionExamples without using Dependency inversion principleExample using Dependency inversion principleIntroduction -

Dependency Inversion Principle is one of the S.O.L.I.D. principles in Object Oriented Programming (OOP), Its main goal is about minimizing coupling or make loose coupling between different modules a...

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 23:12

puts vs printf vs cout in C++

In this article, we have explored the differences between 3 output methods in C namely, puts vs printf vs cout in C .

Table of content-

Introduction to puts,printf and coutTheir properties and implementation.Differences between puts,printf and coutIntroduction to puts,printf and cout -1. puts -

puts is a c library function declared in header file stdio.h. it is used to write a string to stdout puts(str) it writes a string without including the null character .so the new line character ...

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 14:18

Learning to Love WebP

Reading time: 15 minutes | Coding time: 5 minutes

In this article, we have explored the image format WebP along with its advantages and disadvantages and how to use it in HTML files.

Table of ContentsWhy You Hate WebPWhy You'll Love WebPWhat WebP can't doConverting images to and from WebPUsing WebP in Your Website and Browser CompatibilityWhy You Hate WebP Right Now

There are few things as infuriating as right-clicking something on a web page only to discover right-clicking is disabled. ...

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 14:15

Types of Gradient Descent

MathJax example

In this article, we will explore Gradient Descent Algorithm and it's variants. Gradient Descent is an essential optimization algorithm that helps us finding optimum parameters of our machine learning models.

Table of contents:

Quick recap on Linear Regression What is Gradient Descent Varients of Gradient Descent Python Code Question

In short, there are 3 Types of Gradient Descent:

Batch Gradient DescentStochastic Gradient DescentMini B...
 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 13:59

Deployment of Web application using Docker

Containerization is a sort of virtualization wherein every one of the parts of an application are packaged into a one container image and can be run in different and isolated user space on the same device or the same operating system. These containers are lightweight, convenient, and are very easy to deploy on the client side as well.

Docker is an open source containerization platform. It provides the ability to run applications in an isolated environment known as a container.

Containers work in...

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 13:58