Aditya Chatterjee's Blog, page 192
October 12, 2020
Smallest sum contiguous subarray
You are given an array of n integers. The task is to find the sum of the subarray which has the smallest possible sum.
Note: Subarray is an array formed by a block of contiguous elements of the parent ( or original ) array.
Examples
Input:
No. of elements in the array = 5
Array : -4 3 -1 -6 8
Output:
-8
Explanation: The subarray [-4, 3, -1, -6] gives the minimum sum.
Input:
No. of elements in the array = 5
Array : 3 5 1 2 4
Output:
1
Explanation: The subarray [1] gives the minimum sum.
A...
Find if there exists a path between two nodes in a directed graph
You are given a directed graph and two vertices on it. Your task is to find if there exists a path between the first vertex to the second vertex or not.
Example
Consider the following graph:

Input to construct the above graph:
Input:
No. of nodes in graph = 4
No. of edges in graph = 5
Edges:
1 2
2 3
2 4
3 1
3 4
No. of queries = 2
1 4
4 2
Output:
Yes
No
Explanation:
For the first query, the answer is Yes because we can construct a path as shown in the diagram below ( 1->2->4 ) but for ...
Minimum number of operations to make XOR of array equal to zero
You are given an array of n non-negative integers. Your task is to find the minimum number of operations to make XOR of array equal to zero by performing the operations which are defined as follows:
Select the element on which you will perform the operations. Note that all the operations must be performed only on the selected element.
The operation that can be performed are increment and decrement by one.
Examples
Input:
No. of elements in array = 3
Elements = 2 4 7
Output:
1
Expl...
October 11, 2020
Application of BERT : Sentence semantic similarity

In this article, I will be going to introduce you with the another application of BERT for finding out whether a particular pair of sentences have the similar meaning or not .The same concept can also be used to compare two sentences in different form instead of only for the similar meaning these task might be follow up or proceeding sentences or whether two sentences belong to the same related topic or not etc.
Sentence Semantic similarity
In general Natural Language Processing tasks we need to...
Application of BERT : Binary Text Classification

This article focused on implementation of one of the most widely used NLP Task " Text classification " using BERT Language model and Pytorch framework.
Overview of applications of BERT
As we discussed in our previous articles, BERT can be used for a variety of NLP tasks such as Text Classification or Sentence Classification , Semantic Similarity between pairs of Sentences , Question Answering Task with paragraph , Text summarization etc.. but, there are some NLP task where BERT cant used due to ...
Push Relabel Algorithm
Push relabel algorithm is also known as Preflow Push algorithm. It is used for computing maximum flows in a flow network.
Maximum flow in a network graph
In a network graph where every edge has a given capacity, maximum flow is defined as the maximum amount of flow that can move from source to sink. Maximum flow is calculated keeping in mind two constraints,
For every vertex (except source and sink), incoming flow is equal to outgoing flow.
Flow of an edge shouldn't exceed its capacity.
Concep...
October 9, 2020
Hosting websites using GitHub
Github is an online Git Repository hosting service you can use, to host your projects, share your code, contribute to various open source projects and also collaborate with others on a project.
Another awesome feature about GitHub is, you can use it to host your static websites. So, In this tutorial, you will learn how to host fast, secure and reliable static websites (developed using HTML, CSS and JavaScript) on Github for FREE!.
Note: This is a beginner-friendly tutorial. No prior experience ...
Move Semantics in C++
Move semantics might sound like a scary term, but it's relatively easy to understand. This post will explain some of the basic concepts of move semantics, and how important they can be!
References
Before we begin with move semantics, let's do a quick refresher on references. Consider the code below:
int main() {
std::vector vect;
function1(vect);
function2(vect);
}
void function1(std::vector v) {
/*
* This is passing an argument by value
* Modification of "v" here won'...
Travelling Salesman Problem using Branch and Bound approach
In this article we will briefly discuss about the travelling salesman problem and the branch and bound method to solve the same.
What is the problem statement ?
Travelling Salesman Problem is based on a real life scenario, where a salesman from a company has to start from his own city and visit all the assigned cities exactly once and return to his home till the end of the day. The exact problem statement goes like this,
"Given a set of cities and distance between every pair of cities, the probl...
tag in HTML

in HTML is the parent tag, that contains each and every element tags of the HTML document inside of it, except for the tag. It is also known as the root element. You can only use one pair of opening and closing tags.
Categories: None.
Contexts in which this element can be used: As the document's document element.
Wherever a subdocument framework is allowed in a compound document.
Content model: A element followed by a element.
Tag omission in text/html: The start tag can be omited, if the ...


