Aditya Chatterjee's Blog, page 142

November 26, 2021

Number of Integral points inside a triangle

In this article, we have explored an insightful approach/ algorithm to find the number of interior integral points of a triangle. This is an important concept in the field of computational geometry.

p1

TABLE OF CONTENTSProblem Statement DefinitionIntuitionPick's TheoremMathematical FormulationSolution AnalysisArea of a triangleIntegral points on a line segmentNaive approachOptimized approachAlgorithmImplementationPythonC Time-Complexity analysisSpace-Complexity analysi...
 •  0 comments  •  flag
Share on Twitter
Published on November 26, 2021 00:28

November 25, 2021

Pollard’s rho algorithm for factorization

Pollard's Rho Algorithm is a very interesting and quite accessible algorithm for factoring numbers. It was invented by John Pollard in 1975. It is not the fastest algorithm by far but in practice it outperforms trial division by many orders of magnitude. It is based on very simple ideas that can be used in other contexts as well. The amount of space required by this algorithm is very small or less and the running time taken by this particular algorithm is proportional to the square root of the s...

 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 23:25

Deep Dive: Strings in Rust

I've gone into Strings briefly in the beginner's article, but this time, we're going to explore them a little bit more in depth. I will cover some aspects I've already covered only to keep a full 0 to almost 100% info on strings in a single article.

Table of Contents

What are Strings?Creating and Updating StringsString SlicesWhat are Strings?

When we say strings, we mean basically a collection of characters. A 'string' of characters, if you will. Rust has 2 types of strings, one in the core...

 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 13:26

Binary Step Function

[image error]

Binary step function is one of the most common activation function in neural networks out there. But before we get into it let's take a look at what activation functions and neural networks are.

Table of contents:

Brief overview of neural networks and activation functionsWhat is binary step function?ConclusionBrief overview of neural networks and activation functions

Neural networks are a powerful machine learning mechanism that mimic how the human brain learns. Perceptrons are the basic bu...

 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 13:20

List of Randomized Algorithms

In this article, we have listed several important Randomized Algorithms such as Fisher Yates shuffle, Minimum Cut with Karger's, Matrix Product Verification and many more.

Table of ContentsIntroductionLas VegasRandomized QuicksortMonte CarloPi ApproximationMinimum Cut with Karger'sMatrix Product VerificationAtlantic CityOther randomized algorithmsFisher-Yates shuffleReservoir SamplingTesting for prime numbersApplicationsOverview

Prerequisite:

Randomized AlgorithmsFishe...
 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 13:17

Different types of CNN models

In this article, we will discover various CNN (Convolutional Neural Network) models, it's architecture as well as its uses. Go through the list of CNN models.

Table of Contents:

Introduction & Quick Overview about CNN.Types of CNN Models.
2.1 LeNet
2.2 AlexNet
2.3 ResNet
2.4 GoogleNet/InceptionNet
2.5 MobileNetV1
2.6 ZfNet
2.7 Depth based CNNs
2.8 Highway Networks
2.9 Wide ResNet
2.10 VGG
2.11 PolyNet
2.12 Inception v2
2.13 Inception v3 V4 and Inception-ResNet.
2.14 DenseNet
2.15 Pyramidal N...
 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 08:59

First, Best and Worst fit Strategies (Memory Allocation Strategies)

In this article, we will be going through a few strategies which Operating Systems use to fit processes into the main memory during execution. This include First, Best and Worst fit Strategies.

Table of contents:

An Overview to Memory AllocationContiguous Memory AllocationHow do we allocate memory for a Process?First fitBest fitWorst FitFurther talking pointsAn Overview to Memory Allocation:

While executing, every program in a computer has to give certain instructions to the CPU and ...

 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 07:24

Find mirror image of point in 2D plane

In this article, we will learn how to find the mirror image position of a point in a 2D plane along with C++ implementation of the approach.

Table of contentsProblem StatementMirror EquationImplementationCodeProblem Statement

Given a point P(x1,y1) in 2-D plane, find the image of the point P(x1,y1) formed due to the mirror.

Sample input :
(5,1)
Sample output :
Image -> (1,5)

Mirror Equation

In order to get mirror image we must have a mirror first.
You can observe in this image that mirror...

 •  0 comments  •  flag
Share on Twitter
Published on November 25, 2021 07:11

November 24, 2021

Working with CSV files in Python

In this article, we have presented how to work with CSV files (Comma Separated Values) in Python like reading CSV files and processing the information stored in it. We have presented the ideas with Python code examples with output.

Table of contents:

Introduction to CSV fileLoading and reading CSV filesConverting datatypesIntro to Dictionaries in PythonConclusionIntroduction to CSV file

CSV stands for Comma Seperated Values, and it is the most common format used for exchanging and updatin...

 •  0 comments  •  flag
Share on Twitter
Published on November 24, 2021 11:38

3 Sum Smaller Problem

The 3 sum smaller problem is an interesting algorithm problem that we shall be solving in this article. This is an extension of the 3 Sum Problem. In this, we have to select an element from 3 different arrays such that the sum is less than a target.

Table of ContentExamining the Problem StatementSolving the problemThe Straight-Forward ApproachThe Two-Pointer TechniqueConclusion

Prerequisites: Two Pointer Approach, 3 Sum problem

Examining the Problem Statement

Before we dive into the so...

 •  0 comments  •  flag
Share on Twitter
Published on November 24, 2021 08:28