Construct Binary Tree from given Parent Array representation
Given an array that represents a tree in such a way array indexes are values in tree nodes array values give the parent node of that particular index (or node). The value of the root node index would...
View ArticleOOD Principles | SOLID
Object Oriented Programming paradigm deals with centralizing data and associated behaviours in a single entity. The entities will communicate by message passing. The high level languages like C++,...
View ArticleMutex vs Semaphore
What are the differences between Mutex vs Semaphore? When to use mutex and when to use semaphore? Concrete understanding of Operating System concepts is required to design/develop smart applications....
View ArticlePure Functions
A function is called pure function if it always returns the same result for same argument values and it has no side effects like modifying an argument (or global variable) or outputting something. The...
View ArticleAnalysis of Algorithms | Set 1 (Asymptotic Analysis)
Why performance analysis? There are many important things that should be taken care of, like user friendliness, modularity, security, maintainability, etc. Why to worry about performance? The answer to...
View ArticleAnalysis of Algorithms | Set 2 (Worst, Average and Best Cases)
In the previous post, we discussed how Asymptotic analysis overcomes the problems of naive way of analyzing algorithms. In this post, we will take an example of Linear Search and analyze it using...
View ArticleReservoir Sampling
Reservoir sampling is a family of randomized algorithms for randomly choosing k samples from a list of n items, where n is either a very large or unknown number. Typically n is large enough that the...
View ArticleSQL | Union Clause
The Union Clause is used to combine two separate select statements and produce the result set as a union of both the select statements. NOTE: The fields to be used in both the selet statements must be...
View ArticleSQL | Join (Cartesian Join & Self Join)
SQL| JOIN(Inner, Left, Right and Full Joins) In this article, we will discuss about the remaining two JOINS: CARTESIAN JOIN SELF JOIN Consider the two tables below: StudentCourse CARTESIAN JOIN: The...
View ArticleSQL | CREATE
There are two CREATE statements available in SQL: CREATE DATABASE CREATE TABLE CREATE DATABASE A Database is defined as a structured set of data. So, in SQL the very first step to store the data in a...
View ArticleSQL | DROP, TRUNCATE
DROP DROP is used to delete a whole database or just a table.The DROP statement destroys the objects like an existing database, table, index, or view. A DROP statement in SQL removes a component from a...
View ArticleSQL | Constraints
Constraints are the rules that we can apply on the type of data in a table. That is, we can specify the limit on the type of data that can be stored in a particular column in a table using constraints....
View ArticleSQL | Comments
As is any programming languages comments matter a lot in SQL also. In this set we will learn about writing comments in any SQL snippet. Comments can be written in the following three formats: Single...
View ArticleSQL | GROUP BY
The GROUP BY Statement in SQL is used to arrange identical data into groups with the help of some functions. i.e if a particular column has same values in different rows then it will arrange these rows...
View ArticleSQL | Views
Views in SQL are kind of virtual tables. A view also has rows and columns as they are in a real table in the database. We can create a view by selecting fields from one or more tables present in the...
View ArticleSQL | Date functions
In SQL, dates are complicated for newbies, since while working with database, the format of the date in table must be matched with the input date in order to insert. In various scenarios instead of...
View ArticleSQL | Functions (Aggregate and Scalar Functions)
For doing operations on data sql has many built-in functions, they are categorised in two categories and further sub-categorised in different seven functions under each category. The categories are:...
View ArticleSQL Interview Questions
What is SQL? SQL stands for Structured Query Language. It is a language used to interact with the database, i.e to create a database, to create a table in the database, to retrieve data or update a...
View ArticleSQL | Join (Cartesian Join & Self Join)
SQL| JOIN(Inner, Left, Right and Full Joins) In this article, we will discuss about the remaining two JOINS: CARTESIAN JOIN SELF JOIN Consider the two tables below: StudentCourse CARTESIAN JOIN: The...
View ArticleSQL | CREATE
There are two CREATE statements available in SQL: CREATE DATABASE CREATE TABLE CREATE DATABASE A Database is defined as a structured set of data. So, in SQL the very first step to store the data in a...
View Article