The tree is a data structure that is comprised of nodes and edges. These entities are interconnected to each other to form a tree structure. Traversing a data structure means visiting each and every node in that structure and bringing out a sequence of values from that. There are three types of traversals namely, in-order (L→ Root→R ), pre-order(Root→L→R) and, post-order(L→ R → Root) In-order Traversal In the In-order Traversal, the left subtree is visited first, followed by the Root node and finally the right subtree. A binary tree will provide sorted key values in ascending order if it is ... Read More
Linked List is an ordered collection of data elements. In linked list the data will be represented in Nodes. Node has two parts, the first part will be holding the data of the element and second part of the node (pointer) will store the address of the very next node. In linked list elements are stored in a sequential manner. Operations in Linked List There are several operations in Linked list, which are adding a node, deleting a node and searching a node. which are detailed in the below scenarios. Creating a Node Let’s see the scenario of linked list ... Read More
Array is a linear data structure, which is able to store elements of different datatypes. Arrays are also defined as ordered collections. In array each of the value will be referred to as an element and those can be identified with index numbers. const array_name = [item1, item2, ...]; const movies = [Bahubali, RRR, KGF, Pushpa]; //Index values of above elements Bahubali – [0] RRR – [1] KGF – [2] Pushpa – [3] Loops is a programming element, there will be a sequence of instructions defined in the loop and it will continue to iterate till ... Read More
An object is said to be an entity which has properties and types in it. Example, consider a Person as an object and it has properties like height, weight, age and salary. In the similar way JavaScript also have objects and their defined properties. An object in JavaScript is a complicated data type where it can store various data types in it. Let’s consider this example below const employee = { name : ‘Dhoni’, age : 41, height : 5.8, } Cloning an object using JavaScript In general, “Cloning” is ... Read More
Tree is a nonlinear data structure which has nodes and edges; where edges act as link between two nodes and nodes hold values in it. Traversal is a procedure where it will retrieve the data in every node of the tree and print them in a specified sequential order. There are three types of tree traversals which are mentioned below − In-order traversal − In-order technique will follow the path (Left → Root → Right). Pre-order traversal − Pre-order technique will follow the path (Root → Left → Right). Post-order traversal − Post-order technique will follow the path (Left ... Read More
A tree is a non-linear hierarchical data structure and it is a combination of both nodes and edges. Nodes in the tree store the values and these nodes are connected to each other with Edges. The topmost node of the tree doesn’t have any Parent node and is called a Root node. The below Binary search tree is labeled with important terms. Fundamental Terms Node − Has a pointer to another node and the ability to store a value of any data type. Root − This node is at the very top of the tree and is ... Read More
A hemisphere refers to the exact half of a sphere. Means if we divide a sphere in two equal parts then we will get two hemispheres. Hemisphere is a three-dimensional geometrical shape which has one flat face. There are many practical examples of hemispheres. The earth divided into 2 equal parts results 2 hemispheres i.e. Northern hemisphere and Southern hemisphere. The area occupied by the outer surface of a three-dimensional object is called the surface area. Formula to calculate surface area of hemisphere − Mathematically it can be represented as $$\mathrm{Surface \:Area \:= \:2\pi\:r^2}$$ Mathematically it can be represented as ... Read More
A number is said to be an ugly number, if the prime factors of that input number only include 2, 3 and 5. Maybe some number has some prime factors which have only one factor or two factors but those factors must be one of 2, 3, and 5. In this article we will see how to check if a number is an Ugly number or not by using Java programming language. To show you some instances Instance-1 Input number is 20. Let’s check it by using the logic of Ugly number. Prime factors of 20 = 2, 2, 5 ... Read More
A number is said to be a Strong number, if the sum of factorials of the input number’s every digit is equal to the same input number. For more clarification, we have to find the factorial of every digit of the given number. After that we have to calculate the sum of those factorials. Then we have to compare both the sum value and input number, if they are same then the given number is a strong number otherwise it is not a strong number. In this article, we will see how to check if a number is a strong ... Read More
A number is said to be a Spy number, if the sum of the digits of the given number is equal to the product of the digits of the given number. For more clarification, we have to first calculate the sum of the digits of the given number. After that we have to calculate the product of the digits of the given number. Then we have to compare both the sum value and product value, if they are the same then the given number is a spy number otherwise it is not a spy number. In this article, we will ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP