Nikhilesh Aleti has Published 49 Answers

Pre-order traversal in a Javascript Tree

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:47:20

Tree is a hierarchical data structure which includes nodes and edges to it. Edges in tree acts as links connecting two nodes. The Preorder tree traversal is a technique where the root node will be traversed first and then it will traverse the left subtree followed by the right subtree. ... Read More

In-order traversal in Javascript Tree

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:43:42

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 ... Read More

Linked List representation in Javascript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:39:20

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. ... Read More

Looping through an array in Javascript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:32:21

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, ... Read More

How to clone an object in JavaScript?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:19:09

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 ... Read More

Removing a node in a Javascript Tree

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 07:04:25

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 ... Read More

Tree Traversals in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 18-Nov-2022 05:56:44

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 ... Read More

Recursion example in JavaScript to display numbers is descending order?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 08:20:18

In this article, the given task is to display the numbers in descending order by using recursion. Let’s get an understanding of the task by looking into the input-output scenarios. Input-Output scenario Let’s look into an input-output scenario, where there is an input number and we need to print the ... Read More

Checking the equality of array elements (sequence dependent) in JavaScript

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 08:08:50

In this article, the given task is to check the equality of array elements (sequence dependent). Before we proceed into examples, let’s look at how the input-output scenario will look when we are checking the equality of array elements (sequence dependent) in JavaScript. Input-Output scenario Let’s look into the input-output ... Read More

How do we embed custom data attributes on all HTML elements?

Nikhilesh Aleti

Nikhilesh Aleti

Updated on 08-Nov-2022 08:02:07

In this article, we need to embed custom data attributes on all HTML elements. we can do so, using the data-* attribute in HTML. The data-* attribute in HTML is used to custom data private to the webpage or application. This attribute adds custom values to an HTML element. The ... Read More

Advertisements