(Input dependent on previous output) Source:allpagelab

Why do we need a recurrent neural network?

A recurrent neural network is used to model sequence learning problems such as autocomplete, sentiment analysis, etc.

Sequence learning problems are those in which we don't have a fixed size input, and the inputs are no longer independent. This is because the output at any timestamp is dependent on the current and previous input, and we have input at each timestamp. An example of this is the autocomplete feature. It predicts the next letter based on the previous output, sentiment analysis, etc.

Image Classification Using CNN

So What is a Convolution Neural Network?

A network that has multiple convolutional operations at each layer and has multiple such layers is known as a convolutional neural network.

  1. Feed-Forward Neural Network has a denser connection because here, every neuron of the current layer is connected to all the neurons of the previous layer.

Image Source: Towards DataScience

Convolution Operation: As convolution is a mathematical operation on two functions that produces a third function that expresses how the shape of one function is modified by another.

Similarly, CNN is more like a convolution operation where we take different measurements and rely more on the near ones for better results. So here we take revised measurements which is a weighted average of the measurements taken such that the near ones are assigned more weight than the measurements taken earlier.

Image Source — TechVidvan

So What Is Unsupervised Machine Learning?

In unsupervised learning, correct responses are not provided so we try to find the similarity between the inputs and group the similar inputs together.

Different Types Of Unsupervised Machine Learning Algorithm:


When we try to group together the similar type of inputs together using KMeansClustering, here the number of clusters is specified and the model breaks the data into these clusters.

  1. Choose the value of k(number of clusters).
  2. Choose k random positions from the input space and assign cluster center to those positions.
  3. Now comes the learning part we will repeat the below steps up to step 6 until all…

Decision Tree for deciding what to do based on the deadline.

So What Is A Decision Tree?

A decision tree is a tree-like decision structure where at each node a feature value is evaluated and depending upon the evaluation further decisions are made. Output values are represented by the leaf nodes.

By saying how is a decision tree constructed we mean that how we decide in what order the feature values will be evaluated.

We follow a greedy approach while selecting the order in which the features will be evaluated where the most informative feature is evaluated first.

There are different methods and algorithms based on which we decide out of different features which is more informative…

Heap or priority queue is the same thing. Then question arises

What is a priority queue??

A priority queue is a queue where there is a criterion on which elements are prioritized and the element with the highest priority is popped out first.

So why do we need a priority queue or heap??

It is mainly used to find the maximum or minimum element in a better time complexity than any other data structure.

When can a tree be called a heap??

A tree can be called a heap if it satisfies the following three conditions:

  1. The tree should have…

image source your basic

Hash Table data structure is used when we have elements in key-value pairs and we want to search, insert, or delete any pair in average constant time.

However, we should keep in mind that the elements are arranged in any irrelevant order in a hash table.

Key Components Required for Hashing:

  1. Hash Function: This function converts a key into integer values which serve as the location(array index)where the key-value pair is stored corresponding to that key. A good hash function is one that is fast to compute and if using that hash function there are fewer chances of a collision.

Image source ccplusplus

Set is a container used to store unique elements. By default, it is ordered and is used when we want to remove duplicate elements. We cant update any element of a set the only way is to remove that element and insert the other one.

Inserting elements in set:

We can insert the values directly in the set using the insert function:

Introduction :

A binary search tree is a binary tree where the value of every node of the left subtree is less than or equal to the parent node and that of the right subtree is greater than or equal to the parent node. Along with that, every subtree is also a binary search tree.

So why do we need a binary search tree ??

Since searching, inserting, or deleting any element from a binary tree takes O(n) time in every case even if the tree is balanced. However, in the case of the binary search tree in the best case, it…

Image source Zippers

It is a type of tree data structure used to store hierarchical data. Any node of a binary tree can have at most two child nodes.The node of any tree consist of a data part, a pointer to its left child subtree, and a pointer to its right child subtree.

Implementation of node class:


Third year undergraduate at Nit Patna.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store