Suppose we have two binary trees. We have to check whether the smaller tree is a subtree of another binary tree or not. Consider these two trees are given.There are two trees. The second tree is the subtree of the first one. To check this property, we will traverse the tree in post-order fashion, then if the subtree rooted with this node is identical to the second tree, then it is subtree.Example Live Demo#include using namespace std; class node { public: int data; node *left, *right; }; bool areTwoTreeSame(node * t1, node *t2) { if (t1 ... Read More
Here we will see how to check a binary tree is level wise sorted or not. The level wise sorted binary tree will be look like below −In each level, the nodes are sorted from left to right, and each layer contains higher value than its previous level.We can solve this problem by performing level order traversal, and keep track of the minimum and maximum elements of current level. Use another variable prev_max to hold maximum value of the previous level. Then compare the minimum value of current level and maximum value of previous level prev_max. If min value is ... Read More
The industrial landscape is transforming, with technology bridging the gap between the digital and physical world of manufacturing. Loosely being termed as the ‘next Industrial Revolution, ’ systems are being connected intelligently within the entire value chain and support activities of manufacturing; the new face being known as ‘Industry 4.0.’ Over the next decade, Industry 4.0 is expected to add $14.2 trillion to the world economy.SignificanceIndustry 4.0 appositely implies reduced costs, enhanced efficiency and productivity, increased work speed and scale, smarter and proficient products and services. It also refers to the Industrial Internet of Things (IoT). Here, products and services ... Read More
Suppose we have a binary matrix of order M x N. The task is to check whether the matrix is horizontally symmetric, vertically symmetric or both. One matrix is said to be horizontally symmetric if the ith row is the same as the (M – i)th row, this is said to be vertically symmetric if the jth column is the same as the (N – j)th column. Suppose the input matrices are like below −011101011This is Horizontally symmetric.111101111This is Vertically symmetric.111101111This is Horizontally as well as vertically symmetric.We will solve this problem using two phases. At first, we will check ... Read More
When the mobile phones were introduced during the initial period of the 21st century, it was a big leap in the communication system. Mobile phones have changed and influenced to the core. This also created a huge market for Mobile Communication, Mobile Phones, Mobile Operating System and Mobile Application. In the mobile communication system, smartphones are considered as the biggest milestone. Smartphones had made the life human beings quite efficient as well bit lazy too.The introduction of Android Operating system by Google was another big leap in mobile systems. Android has created a huge market for the developer to develop ... Read More
Do you wish to initiate a new business, need help with business decisions, analyze immense amount of data, create a chatbot or song, need help with recipes, or have a business that is leaving money on the table? Get all your answers from ‘Watson.’Created by IBM, Watson is a supercomputer that works as a ‘question answering’ machine while combining artificial intelligence (AI) along with predictive analytical software. Named after IBM’s founder Thomas J. Watson, it is a cognitive technology that can understand, reason and think like a human.With Watson, through questions designed in natural language, one can analyze, visualize, and ... Read More
Flip-Flops are sequential digital circuits. There are few different types of flip-flops. Here we will see the types of flip-flops and the conversion rules from one flip-flop to another.There are basically four types of flip-flops −SR Flip-FlopD Flip-FlopJK Flip-FlopT Flip-FlopSR Flip-flopSR flip-flop operates with only positive clock transitions or negative clock transitions. Whereas, SR latch operates with enable signal. The circuit diagram of SR flip-flop is shown in the following figure.This circuit has two inputs S & R and two outputs Q(t) & Q(t)’. The operation of SR flipflop is similar to SR Latch. But, this flip-flop affects the outputs ... Read More
The digital world has always been action packed and aggressively competitive since its existence. With exponentially continuous breakthroughs in the world of science and technology, the tech giants like Microsoft, Google, and Apple have been within a perpetual war against each other and the war doesn’t seem to come to an end in the near future.Unlike other kinds of war, whether real or virtual, instead of destructive consequences, this ‘tech-war’ only has constructive consequences bringing an immense amount of productivity for the end users like me and you. This competition in technology has shaped our present and will define our ... Read More
With the commercial launch of Reliance Jio services on September 5, 2016, the telecom operator introduced ‘Welcome Offer’ with free voice and data (with a cap of 4GB data per day) services on the Jio SIM up to December 31, 2016. The company extended the ‘Welcome Offer’ by another three months till March 31, 2017 by relaunching it as the ‘Happy New Year Offer.’Welcome Offer’ also offered free voice calls, video calling, messaging and data, but with a data limit of 1GB per day. Reliance Jio claimed to be the fastest growing technology company in the world, and had close ... Read More
Today, the time has been changed with the touch of automation technology which is developing enormously every now and then. Each new era of automobile is getting furnished with more mechanized components and crash averting technology. They are getting integrated with advanced options, such as blind-spot observing, forward-crash warnings, lane-departure warnings etc. Another such feature is auto-driving mode.Commonly, many have some misconception between ‘autonomous or automated driving’ and ‘self driving’. These terms are fundamentally different from each other. When it comes to the construction of auto-driving mode activated cars, they are similar to normal ones and can ready to assume ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP