Algorithms Multiple array range increments in linear time O(N) Given an array a containing N integers, we perform M queries. Each query has three values START, END and a value D. For each query, the problem is to increment the values from the start to end index(both inclusive) in the given array by the given value d. An efficient algorithm takes O(N+M) time
C++ Unique_ptr in C++ A unique_ptr is like a normal pointer, except the fact that it "owns" the object to which it points, as mentioned above. The word "unique" in the title refers to the fact that at a time, only one unique_ptr can point to a given object and the object is destroyed when the pointer is destroyed.
Algorithms Sieve of Atkin Sieve of Atkin is an algorithm used to find all prime numbers upto a given number (say N) and does so in O(N) time complexity. With a modified version with enumerating lattice points variation, the time complexity goes to O(N / log log N). It is computationally efficient than Sieve of Eratosthenes
Data Structures Union Find (Disjoint Set) A Union Find data structure (also called disjoint-set) is a data structure that keeps track of elements partitioned into a number of disjoint subsets. It provides near-constant-time operations to add new sets, to merge existing sets, and to determine whether elements are in the same set.
C++ Program Flow control in C++ The flow of control jumps from one part of the program to another, depending on calculations performed in the program. Program statements that cause such jumps are called control statements. We have covered for, while, do while loop, if else, switch, break, continue, goto and functions.
C++ Friend Function in C++ C++ allows a mechanism, in which a non-member function has access permission to the private members of the class. This can be done by declaring a non-member function friend to the class whose private data is to be accessed. The friend is a keyword.
Software Engineering Understand Inheritance in depth Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. The different types of inheritance are single, multilevel, hierarchical, hybrid, multipath and multiple inheritance
C++ Operator Overloading in C++ Operator overloading is an important concept in C++. It is a type of polymorphism in which an operator is overloaded to give user defined meaning to it. Overloaded operator is used to perform operation on user-defined data type. We give examples of unary ++, bitwise + and arithmetic + operators
Algorithms Area of Triangle: Heron's formula We take a look at Heron's formula which will enable us to calculate the area of any triangle given the length of the three sides of that triangle. The advantage is that the area is calculated using arithmetic operations and hence, the time taken can be assumed to be constant,
Machine Learning (ML) Bias in Machine learning Bias is an constant parameter in the Neural Network which is used in adjusting the output. Therefore Bias is a additional parameter which helps the model so that it can perfectly fit for the given data. It is also known as bias nodes, bias neurons, or bias units
Machine Learning (ML) Implementing CNN in Python with Tensorflow for MNIST digit recognition In this article, we will develop and train a convolutional neural network (CNN) in Python using TensorFlow for digit recognifition with MNIST as our dataset. We will give an overview of the MNIST dataset and the model architecture we will work on before diving into the code.
Machine Learning (ML) Logistic Regression in Python with TensorFlow We will walk you though the difference between Linear and Logistic Regression and then, take a deep look into implementing Logistic Regression in Python using TensorFlow. We used the Iris dataset and have trained and plotted the loss function and the training and test accuracy across epochs
C Programming Storage classes in C A Storage Class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. Storage classes are used in C programming are Automatic variables (auto), External variables (extern) Static variables (static) and Register variable
Algorithms Circle Sort Circle sort is a sorting algorithm in which diametrically opposite elements are compared to each other and swapped with an average time complexity of O(N log N) and space complexity of O(1). It is an unstable, recursive, parallelizable, in place sorting algorithm
Data Structures K Dimensional Tree / (K D Tree) K Dimensional tree (or k-d tree) is a tree data structure that is used to represent points in a k-dimensional space. It is used for various applications like nearest point (in k-dimensional space), efficient storage of spatial data, range search. We implemented it in C++ and explained the operations
Machine Learning (ML) Training, saving and loading Artificial Neural Networks in Keras We demonstrate how to code a Artificial neural network model and train and save it in JSON or H5 format which can be loaded later for any inference task. We use Keras/ TensorFlow to demonstrate this transfer learning and used Pima Indian Diabetes dataset in CSV format
Machine Learning (ML) Random Decision Forest Random forests or random decision forests are an ensemble learning method for classification, regression and other tasks that operates by constructing a multitude of decision trees at training time. There are three important hyperparameters namely n_estimators, random_state and max_features
Machine Learning (ML) Generative Model A Generative Model is a way of learning any kind of data distribution. Generative modeling algorithms process the training data and make reductions in the data. The main aim is to learn the true data distribution of the training set so that the new data points are generated with some variations.
Machine Learning (ML) Discriminative Model Discriminative models, also referred to as conditional models, are a class of models used in statistical classification, especially in supervised machine learning. Discriminative modelling studies the P(y|x) i.e, it predicts probability of y(target) when given x(training samples).
Machine Learning (ML) XGBoost XGBoost is short for extreme gradient boosting. It is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable. It implements machine learning algorithms under the Gradient Boosting framework. It provides a parallel tree boosting known as GBDT, GBM
Machine Learning (ML) Independent Component Analysis (ICA) Independent component analysis (ICA) is a statistical and computational technique for revealing hidden factors that underlie sets of random variables, measurements, or signals and is a special case of blind source separation. A common application is to listen to one person's speech in a noisy room
C++ Threads in C++ Threads are generally referred to as lightweight processes and executes different parts of a program and shares memory, file descriptors and system resources. We explore multithreading creation of threads with free, member function, functor object, lambda expression, race condition with mutex
C Programming Dynamic memory allocation in C The process of allocating memory at run time is known as dynamic memory allocation. Although C does not inherently have this facility, there are four library routines that can be used for allocating and freeing memory during program execution: malloc, calloc, realloc and free
C++ Function Overriding in C++ Function overriding (compile time polymorphism) is a feature in C++ that allows us to have a function in child class which is already present in the parent class. A child class inherits the data members and member functions of parent class and to override functionality, function overriding is used
C++ Function Overloading in C++ Function overloading is a feature in C++ where two or more functions can have the same name but different parameters. This is used in situations when a class B is inherits from class A and a particular behaviour of the class B needs to be modified.