Aditya Chatterjee's Blog, page 151

October 22, 2021

Size of 2D vector in C++

In this article, we will learn how to get size of 2D vector in C++. This topic has a wide applications such as in graphs, or even in machine learning. Getting used to handling 2D vectors in C++ helps us approach our problems easier.

Table of contents:

Size of 1D vector in C++Size of 2D vector MxN in C++What if our 2D vector has different column size?

Prerequisite: 2D vector in C++

Let us get started with Size of 2D vector in C++. We have also covered how to get total number of elements in 2D...

 •  0 comments  •  flag
Share on Twitter
Published on October 22, 2021 21:03

October 21, 2021

Interview Questions on Theory of Computation (MCQ)

In this article, we have present Interview Questions on Theory of Computation (MCQ). You must attempt these questions. All answers have been provided which will help you get prepared in Theory of Computation.

Let us get started with Interview Questions on Theory of Computation (MCQ).

1. What is the definition of Algorithm according to Theory of Computation?Turing MachineMulti-tape Turing MachineAutomatonRegular ExpressionIn Theory of Computation, Algorithm is defined as a series of ste...
 •  0 comments  •  flag
Share on Twitter
Published on October 21, 2021 09:05

Interview Questions on Rust Programming (MCQ)

In this article, we have presented the most asked Interview Questions on Rust Programming (MCQ). You must try to answer this to judge your expertise in Rust Programming Language. All questions have been explained with answers.

You can learn some basics of Rust before answering the questions.
Let us get started answering Interview Questions on Rust Programming:

1. Which keyword is used to define a variable in Rustletf32mulconstlet keyword is used to declare a variable in Rust. A sample ...
 •  0 comments  •  flag
Share on Twitter
Published on October 21, 2021 08:23

October 20, 2021

Merge two sorted linked lists

In this article, we will learn how to Merge two sorted linked list such that the final linked list is also sorted in linear time O(N).

Table of contents:

Problem Statement: Merge two sorted linked listsAlgorithmImplementation (Step by Step)

Let us get started with Merge two sorted linked lists.

Problem Statement: Merge two sorted linked lists

Merge two given sorted linked list and return head of new linked list which should also be sorted.

merge_ex1

Example :

Input: linked list 1 = {1,2,4} , linked l...

 •  0 comments  •  flag
Share on Twitter
Published on October 20, 2021 00:24

October 19, 2021

Scapegoat tree

In this article, we will explore in detail about Scapegoat tree which is a Self Balancing Binary Tree without requiring any extra space which puts Scapegoat Tree at an unique advantage.

Table of contents

Binary treeSelf balancing binary treeScapegoat treePartial rebuildingIn-depth analysis of scapegoat treePython implementationComplexity analysis

Let us get started with Scapegoat tree.

Binary tree

When all non-leaf nodes of a tree data structure has atmost 2 children, then such a d...

 •  0 comments  •  flag
Share on Twitter
Published on October 19, 2021 23:53

Longest Common Prefix

In this article, we are going to explore different approaches to find the longest common prefix between two strings. Same techniques can be applied to find the Longest Common Prefix for multiple strings.

Table of ContentExamining the Problem StatementDifferent Approaches to Solving the ProblemThe iterative character matching approachThe Trie approachConclusionExamining the Problem Statement

Before we start solving any problem we have to understand what the problem statement entails. H...

 •  0 comments  •  flag
Share on Twitter
Published on October 19, 2021 23:20

4 Sum problem

Reading time: 50 minutes | Coding time: 60 minutes

In this article, we have explored an insightful approach/ algorithm to find the 4 elements in an array whose sum is equal to the required answer (4 Sum problem). This concept finds many uses in computational geometry.

CONTENTS OF THE ARTICLE:Problem Statement DefinitionMethod 1: Naive approachMethod 2: Sorting for efficiencyMethod 3: Auxiliary Space approachMethod 4: Hashing Based Solution (1)Method 5: Hashing Based Solution (2)Method 6...
 •  0 comments  •  flag
Share on Twitter
Published on October 19, 2021 14:39

ShuffleNet Series (Part 2): A Comparison with Popular CNN architectures

Let's recall...ShuffleNet Series (Part 2): A Comparison with Popular CNN architectures

As discussed in depth in Part 1 of this series, born in 2017, ShuffleNet is a powerful CNN architecture for object detection in small devices that works on low computing as well as storage power. It is based on 3 famous architectures; GoogleNet, Xception and ResNet. The primary operation that does all the magic is the Channel Shuffle operation. ShuffleNet has been improved and released as ShuffleNet V2. It highlights 4 guidelines and also implements the same to give a better, fas...

 •  0 comments  •  flag
Share on Twitter
Published on October 19, 2021 09:15

October 18, 2021

BERT Large Model

BERT large model is a pretrained model on English language which uses a Masked Language Modeling (MLM for short). It has 24 encoder layers. The model was first introduced in this paper and subsequently released in this repository.

Pre-requisite: BERT model, BERT for text summarization

Table of content:

What is BERT Large?A world before BERT: Word2Vec and GloVe
2.1 Elimination of Polysemy: ELMo and ULMFiT
2.2 And now BERTA look under BERT Large's architecture
3.1 Text pre-processing
3.2 Pre-tr...
 •  0 comments  •  flag
Share on Twitter
Published on October 18, 2021 05:45

Implement K stacks in one array

In this article, we have present two approaches to design K stacks in one array. The challenge is to efficiently store the elements to use all available space in the array and maintain the time complexity of stack operations.

Table of contents:

Simple methodEfficient method

Prerequisite: Stack, Array

Let us get started with Implement K stacks in one array.

Simple method

In this method we will create array of some size and divide that array into k parts for storing elements of k stacks

for imp...

 •  0 comments  •  flag
Share on Twitter
Published on October 18, 2021 04:32