Aditya Chatterjee's Blog, page 181

January 21, 2021

ResNet50 v1.5

ResNet50 v1.5 is the modified version of the original ResNet50 model. ResNet50 v1.5 is slightly more accurate (0.5%) and slightly lower performance (down by 5%) compared to ResNet50.

Hence, ResNet50 v1.5 is used in applications where the slight improvement in accuracy matters and the small performance bottleneck is not an issue.

The difference in the architecture of ResNet50 and ResNet50 v1.5 is that, in the bottleneck blocks which requires downsampling, v1 has stride = 2 in the first 1x1 convol...

 •  0 comments  •  flag
Share on Twitter
Published on January 21, 2021 22:34

January 20, 2021

Minimum steps to make binary string empty by removing alternating subsequence in each step

Given a string str consisting of only '0's and '1's, the task is to make the string empty by performing minimum number of operations. An operation is defined as the removal of an alternating subsequence from str without changing the order of the remaining characters. An alternating subsequence is defined as any subsequence in str, of at least length 1, where no two consecutive characters are equal. Ex: "0", "1", "10", "01", "101", etc.

Examples Input: str = "1011" Output: 2 Explanati...
 •  0 comments  •  flag
Share on Twitter
Published on January 20, 2021 08:55

Digit Separators in C++

In this article we are going to discuss about Digit Separators in C++. This topic is introduced in C++14. Using digit separators in the code make it easy for human readers to parse large numeric values.

Problem Detection

As we can see, everyone around us is in fond of comfort so when it comes to read a number having many digits, it seems sometimes difficult.
For example : Reading a number like 1000 is easy but when the number is like 1000000 it becomes little difficult and uncomfortable to read ...

 •  0 comments  •  flag
Share on Twitter
Published on January 20, 2021 08:47

Minimum elements to be removed from array to make the sum even

Given an array of integer and you have to find minimum no of integers or elements from array need to be removed so that sum of all elements of array results an even value.

The first thing which comes in mind is that sum can be even only if number of odd terms are even. If number of odd terms are odd sum will result in odd value.
As we know -

odd odd = eveneven odd = odd--> even times odd = even--> odd times odd = odd

No issue with number of even values in array either they are odd times or e...

 •  0 comments  •  flag
Share on Twitter
Published on January 20, 2021 08:45

Algorithm behind Bill splitting app

Algorithm behind Bill splitting app

In this article, we have explored the algorithms that are used to design a Bill splitting app. Bill Splitting app is a really simple project idea which is inspired by Splitwise App. So what basically is an Splitwise App?

Splitwise is an App which makes it easy to split bills with friends and family. They organize all your shared expenses in one place so that everyone can see who they owe.

For example, there are group of friends (Yusuf, Harshit, Himanshu, and Yash) and they have made expenses a...

 •  0 comments  •  flag
Share on Twitter
Published on January 20, 2021 08:41

January 18, 2021

System Design of File Uploading Service

In this article, we'll be discussing things we're supposed to keep in mind while designing a web-based file uploading service, handling and restricting the number of uploads by the user, how to handle version history in the database, and efficiently come up with a design.

Now, I'm sure most of us must have used Google Drive or Dropbox for uploading your files and sharing it across the web if we think about it, how does the internal system work for these applications? What all to keep in mind if ...

 •  0 comments  •  flag
Share on Twitter
Published on January 18, 2021 08:45

Heavy Light Decomposition of tree

Heavy Light Decomposition of tree

Heavy Light Decomposition,a competitive programming algorithm is very useful in solving queries efficiently. We will see its usecase, implementation and finally solve few problems based on it.

Heavy Light Decomposition is an interesting topic and it needs quite a few prequisites which we will be covering through.

Basic Terms:Segment trees

Segment trees store the sum of elements of an array and are broken down as they move down.
So the array given is of size 5.HereA[x:y] denotes the sum of a...

 •  0 comments  •  flag
Share on Twitter
Published on January 18, 2021 08:34

Soft heap

Soft heap is a variant of heap data structure (priority queue). It is a powerful data structure owing to amortized constant time complexity of some basic functions.

Following are the 5 operations that have an amortized constant time complexity

create(S): Create a new soft heapinsert(S,x): Insert an element in the soft heapmeld(S1,S2): Merge the 2 soft heaps to get onedelete(S,x): Delete an element from the soft heapfindMin(S): Get the minimum element in the soft heap

It merits to beat the ...

 •  0 comments  •  flag
Share on Twitter
Published on January 18, 2021 08:31

January 17, 2021

Basics of CSS (Cascading Style Sheets)

Basics of CSS (Cascading Style Sheets)

Cascading Style Sheets (CSS) is a style sheet language which is used for designing the webpages and their layouts developed in a markup language like HTML. In this article, you will learn how to use CSS in your projects and some of its basic and most useful CSS properties and rules to design your websites.

Note: Before starting to learn CSS, make sure you have a basic understanding of HTML and its tags. Besides that, no other prerequisites for this tutorial.

But, why CSS?

In the early 90s, when ...

 •  0 comments  •  flag
Share on Twitter
Published on January 17, 2021 12:30

Longest Decreasing Subsequence using Dynamic Programming

In this problem (Longest Decreasing Subsequence), you are given an array of length N. You have to find the longest decreasing subsequence (LDS) from the given array. The longest decreasing subsequence problem is to find a sequence in which the subsequence's elements are in highest to lowest order and the subsequence is as long as possible. We will try to solve this problem using Dynamic Programming which will take O(n²) time complexity.

For example, consider below subsequence

[15, 27, 14, 38, 63...
 •  0 comments  •  flag
Share on Twitter
Published on January 17, 2021 12:23