Articles on Trending Technologies

Technical articles with clear explanations and examples

C++ Program to Perform Inorder Recursive Traversal of a Given Binary Tree

Nishu Kumari
Nishu Kumari
Updated on 16-May-2025 16K+ Views

Tree traversal is a form of graph traversal. It involves checking or printing each node in the tree exactly once. The inorder traversal of a binary tree involves visiting each of the nodes in the tree in the order (Left, Root, Right). An example of Inorder traversal of a binary tree is as follows. Here, we start at the leftmost node(5), move up to 6, then to 2, then to root 3, and continue to the right side with 9 then 4 and 8. Using Recursion for Inorder Traversal Recursion is a technique where a function ...

Read More

C++ Program to Perform Right Rotation on a Binary Search Tree

Farhan Muhamed
Farhan Muhamed
Updated on 16-May-2025 1K+ Views

Binary Search Tree (BST) is a special binary tree in which the left subtree of a node contains only nodes with values less than the node's value, and the right subtree contains only nodes with values greater than the node's value. In this article, we will learn how to perform a right rotation on a BST node using C++. What is Right Rotation in BST? Right rotation is a type of tree rotation technique that is used to balance a binary search tree. In the right rotation around a node, the node is moved to the right in such ...

Read More

C++ Program to Perform Postorder Non-Recursive Traversal of a Given Binary Tree

Farhan Muhamed
Farhan Muhamed
Updated on 16-May-2025 688 Views

Binary Tree traversal is a process of visiting all the nodes in a certain order. In this article, we will learn how to perform postorder non-recursive traversal of a binary tree using two stacks in C++. What is Postorder Non-Recursive Traversal? Postorder traversal is a type of depth-first traversal where we first visit the left subtree, then the right subtree, and then the root node. In a non-recursive approach, we are not allowed to use recursive functions to track nodes for traversing the tree. Instead, we can use stack data structures to manually keep track of the nodes. This ...

Read More

What are the different steps involved to execute a Java program?

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2025 3K+ Views

Java is an object-oriented programming language that provides various features like platform independence, security, garbage collection, etc. Unlike other programming languages, programs written in Java go through a specific sequence of steps during the compilation and execution process. Java follows the same process no matter where and how you compile and execute Java programs, whether using an IDE or the Command Prompt. In this article, we will discuss and understand the steps Java follows to execute programs. Compilation and Execution Process of Java Program Java program execution follows 5 major steps, which are as follows: Step 1: Edit or ...

Read More

What are the differences between ClassNotFoundException and NoClassDefFoundError in Java?\\n

Shriansh Kumar
Shriansh Kumar
Updated on 16-May-2025 5K+ Views

In Java, both ClassNotFoundException and NoClassDefFoundError are issues that occur when the JVM or ClassLoader is not able to find the appropriate class at the time of loading (run-time). The ClassNotFoundException is a checked exception, and NoClassDefFoundError is an Error that comes under unchecked. There are different types of ClassLoaders, each responsible for loading classes from different sources such as directories, JAR files, or network locations. If a required class is missing due to an incorrect classpath or a missing JAR file, the ClassLoader might fail to load it. This situation leads to one of these two issues. The ClassNotFoundException in ...

Read More

C++ Program to Perform Postorder Recursive Traversal of a Given Binary Tree

Nishu Kumari
Nishu Kumari
Updated on 16-May-2025 5K+ Views

A binary tree is a tree data structure where each node has zero, one, or two children. Even an empty tree is called a valid binary tree. Our goal is to write a C++ program to perform postorder recursive traversal on a given binary tree. Traversal means visiting all the nodes in a tree exactly once. In postorder traversal, we visit the left child (left subtree) first, then the right child (right subtree), and finally the root node. Let's take a small binary tree and look at an example. Here, we first ...

Read More

C++ Program to Find Transpose of a Matrix

Nishu Kumari
Nishu Kumari
Updated on 16-May-2025 14K+ Views

A matrix is a rectangular array of numbers arranged in rows and columns. To find the transpose of a matrix, we arrange the rows of the original matrix as columns in a new matrix. Similarly, the columns can also be arranged as rows. An example of the transpose of a matrix is as follows: Finding Transpose of a Matrix To find the transpose of a matrix in C++, we use multidimensional arrays to store matrix values in rows and columns. Then, we swap the rows and columns to get the transpose. Below are the steps we followed: ...

Read More

How to declare a variable in Python without assigning a value to it?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 16-May-2025 11K+ Views

Python variable is a name that you give to something in your program. It basically helps you keep track of objects, which are things like numbers, words or any other data. When you assign an object to a variable, you can use that name to refer to that object later. The data, on the other hand, is still contained within the object. For example, a is assigned the value 100. Here 'a' is a variable. a = 100 This assignment creates an integer object with the value 100 and assigns the variable a to point to that object. In ...

Read More

What is the difference between working of append and + operator in a list in Python?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 16-May-2025 4K+ Views

In this article, we will see the differences between two common ways of adding elements to lists in Python: the append method and the "+" operator.   The append() method is used to add elements to the list by utilizing a mutator() method. The '+' operator is used to create a new list with the capacity for one more element. Behaviour of "+" with Python Lists Python accesses each element of the first list by using the '+' operator. When the '+' symbol is used, a new list with the capacity for one more element is produced. The old ...

Read More

What is a sequence data type in Python?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 16-May-2025 18K+ Views

Sequence Data Types are used to store data in containers in the Python programming language. The different types of containers used to store the data are List, Tuple, and String. Lists are mutable and can hold data of any type, whereas Strings are immutable and can only store data of the str type. Tuples are immutable data types that can store any sort of value. So let's discuss these data types one by one in the coming section - List The sequential data-type class includes the list data type. The list is the only mutable data type in the sequential ...

Read More
Showing 881–890 of 61,248 articles
« Prev 1 87 88 89 90 91 6125 Next »
Advertisements