Aditya Chatterjee's Blog, page 172

April 22, 2021

Design of Rate Limiting System

Wisdom is not a product of schooling but of the lifelong attempt to acquire it.” – Albert Einstein , is the thought for today. If you want to make sure the services and resources are made use reasonably then you are at the right place! Let's begin!!

The first question that comes to our mind is what is Rate limiting? Basically rate limiting is mainly used to control the amount of incoming and outgoing traffic within the networks. Consider a website of your own which handles multiple requests. So...

 •  0 comments  •  flag
Share on Twitter
Published on April 22, 2021 05:57

April 21, 2021

Introduction to Cocoa Pods

Introduction to Cocoa Pods

Hello everyone in this article at OPENGENUS, we are going to see an introduction to CocoaPod and how to use it with an example app.

What is CocoaPod

CocoaPods are application level dependency manager for Objective-C, Swift and any other languages that run on the Objective-C runtime,In simple terms it means a piece of code which is written by others and it can be added in your app.It saves development time by allowing the developers to perform reusability of the code.You can even publish your ow...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 15:02

Email Password Authentication using FireBase in iOS App

Email Password Authentication using FireBase in iOS App

Hello everyone, in this article at OPENGENUS, we are going to see how to add firebase authentication in iOS apps using firebase Email password authentication.

What is FireBase

Email Password Authentication using FireBase in iOS App
Firebase is a cloud service owned by Google which allow the Web,App and also Unity game developers to add some common functionalities like Authentication, Database, Analytics to their application without any need for expensive infrastructure. FireBase provides various kinds of services:

Authentication - Email,Google,Appl...
 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 14:50

TreeSet in Java

TreeSet is created using the implementations of the SortedSet interface in Java and it uses Tree for storage. Objects that are stored in a TreeSet are in sorted and ascending order, this is done by ethier using set's natural ordering or by explicitly providing a comparator.

Hierarchy of TreeSet class

Java TreeSet class implements the NavigableSet interface,Furthur NavigableSet interface extends SortedSet, Set, Collection and Iterable interfaces in hierarchical order.

Screenshot-from-2021-03-07-14-36-20

Creating a TreeSet

Below i...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 14:25

Level order traversal of a Binary Tree

Given a binary tree, we are supposed to traverse the tree using the level order traversal. Level order traversal is just another word for the Breadth First Traversal i.e. traverse the tree level-by-level. Contrary to Depth First Traversal, where we traverse deeper into the tree, level order traversal (or breadth first traversal or breadth first search) traverses every node in a level before going into the next level. The search tree is broadened on each level before going into another level.

Let...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 08:14

Coin Change Problem

Coin change problem is very similar to unbounded knapsack problem which can be solved easily and efficiently by using Dynamic Programming. General task is to find maximum number of ways to add the coins from the array for given amount. Here supply of each type of coin in an array is limitless.

Here we will see recursice aprroach and dynamic programming approach a approach to solve this problem.

Coin Chnage Problem - Maximum number of Ways

Problem Statement:

Given an amount and an array of coins ...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 08:09

Deleted function in C++

C++11 introduced a new use of the delete keyword to make a function non-callable.

Introduction

Functions are a set of statements put together that perform a specific task. Member functions include the operators and functions that are members of a class. While the user has to provide these member functions, the compiler generates some of the functions which are known as special member functions.

We may want to disable the use of such functions. The reason may be to restrict certain features (defi...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 08:06

Default functions in C++11

C++11 introduced a new use of the default keyword as a way to explicitly tell the compiler that a special member function will use the default implementation.

Introduction

Functions are a set of statements put together that perform a specific task. Member functions include the operators and functions that are members of a class. While the user has to provide these member functions, the compiler generates some of the functions which are known as special member functions.

The special member functi...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 07:14

Maximal Rectangle problem (using Monotonic queue)

The objective of this article is to solve the maximal rectangle problem using Monotonic queue. In this problem we are given a matrix consisting of only 0's and 1's, we need to find the largest rectangle consisting of only 1's and return its area.

Monotonic queue approach

In this method, we are going to construct a histogram and find the largest rectangle area that can be formed in the histogram for each row and compare these values to find the maximum rectangular area that can be formed in the g...

 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 00:14

Monotonic Queue (with Daily Temperatures & Largest Rectangle in Histogram)

What do you mean by monotonic queue?

Monotonic queue is a data structure where the data is entirely in non-decreasing order or entirely in non-increasing order. It is generally used for optimizing dynamic programming techniques. Monotonic queues can be used to solve problems that require us to find the greater/min/max till a particular window. We have explained the idea with 2 problems:

Daily Temperatures problemLargest Rectangle in HistogramImplementing non-increasing and non-decreasing mon...
 •  0 comments  •  flag
Share on Twitter
Published on April 21, 2021 00:08