Java Program to Create Expression Tree from Infix, Postfix and Prefix Expressions

This is a java program to construct an expression tree using infix expression and perform the infix, prefix and postfix traversal of the expression tree. The leaves of a binary expression tree are operands, such as constants or variable names, and the other nodes contain operators. These particular trees happen to be binary, because all … Read more

advertisement

Java Program to Implement Double Order Traversal of a Binary Tree

This is a Java Program to perform Double Order traversal over binary tree. Recurse through: 1. Visit root of (sub)tree. 2. Visit left sub-tree. 3. Revisit root of (sub)tree. 4. Visit right sub-tree. Here is the source code of the Java Program to Implement Double Order Traversal of a Binary Tree. The Java program is … Read more

advertisement

Java Program to Perform Insertion in Binary Search Tree

This is a Java Program to perform insertion in the binary search tree. Here is the source code of the Java Program to Perform Insertion in a BST. The Java program is successfully compiled and run on a Windows system. The program output is also shown below. //This is a java program to insert elements … Read more

advertisement

Java Program to Perform Deletion in Binary Search Tree

This is a Java Program to perform deletion in the binary search tree. Here is the source code of the Java Program to Perform Deletion in a BST. The Java program is successfully compiled and run on a Windows system. The program output is also shown below. //This is a java program to delete elements … Read more

advertisement

Java Program to Print the Nodes at Odd Levels of a Tree

This is a Java Program to implement a Binary Tree and print the level order traversal of the same, such that only odd levels are considered. At current level check nodes in next to next level and put them in Queue, dequeue them one by one and print them. Here is the source code of … Read more

advertisement

Java Program to Search an Element in a Binary Search Tree

This is a java program to search an element using Binary Search Tree. A regular tree traversal algorithm is implemented to search an element. We start from root, if value to be searched is less than root we traverse left, else we check if its greater we traverse right, else it is equal and return … Read more

advertisement

Graph Representation using 2D Arrays in Java

This is a java program to represent graph as a 2D array. Nodes are arranged in matrix and at an index of i, j zero is displayed if nodes i and j are not connected, one otherwise. Here is the source code of the Java Program to Represent Graph Using 2D Arrays. The Java program … Read more

advertisement

Graph Representation using Linked List in Java

This is a java program to represent graph as a linked list. Each node will have a linked list consisting of node to which it is connected. Here is the source code of the Java Program to Represent Graph Using Linked List. The Java program is successfully compiled and run on a Windows system. The … Read more

advertisement

Java Program to Implement Sorted List

This is a Java Program to Implement Sorted List. Here Sorted list is implemented using an array list and each inserted element is placed at correct position in the list by insertion sort. Here is the source code of the Java Program to Implement Sorted List. The Java program is successfully compiled and run on … Read more

advertisement

Java Program to Implement Sorted Vector

This is a Java Program to Implement Sorted Vector. Here Sorted vector is implemented using a vector and each inserted element is placed at correct position in the vector by insertion sort. Here is the source code of the Java Program to Implement Sorted Vector. The Java program is successfully compiled and run on a … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.