EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Types of methods in java

Types of methods:   class Methods { public void add()//without returntype/without argument { int a=123; int b=10; System.out.println(“Addition=” +(a+b)); } } class Functiondemo { public static void main(String args[]) { Methods o=new Methods();//classname objectname=new classname(); o.add(); } }   import java.util.*; class Methods { public void sub(int x,int y)//without returntype/with /arguments { System.out.println(“Subtraction=” +(x-y)); } […]

โœ… Java Code: Sum of All Nodes (Minimal Version)

Here is a simple and short Java program to find the sum of all nodes in a binary tree using recursion: โœ… Java Code: Sum of All Nodes (Minimal Version) class Node { int data; Node left, right; Node(int data) { this.data = data; } }   public class SumOfNodes {   int sum(Node node) […]

Java Code: Height of Binary Tree

Java Code: Height of Binary Tree Here’s a simple Java program to find the height of a Binary Tree:   โœ… Java Code: Height of Binary Tree // Definition for a binary tree node class Node { int data; Node left, right;   public Node(int item) { data = item; left = right = null; […]

Java Code: Count Leaf Nodes (Minimal Version)

Java Code: Count Leaf Nodes (Minimal Version) Here is a short and simple Java code to count the number of leaf nodes in a binary tree using recursion:   โœ… Java Code: Count Leaf Nodes (Minimal Version class Node { int data; Node left, right; Node(int data) { this.data = data; } }   public […]

Java Code: Find Maximum Element in Binary Tree

Java Code: Find Maximum Element in Binary Tree // Node class definition class Node { int data; Node left, right;   public Node(int item) { data = item; left = right = null; } }   public class BinaryTreeMax {   // Function to find the maximum element in the binary tree int findMax(Node node) […]

Java practice programs in data structure

=== Student Management Menu === 1. Add Student 2. Display All Students 3. Search Student by Roll No 4. Remove Student 5. Exit Enter your choice: 1 Enter Roll No: 101 Enter Name: aaa Student added successfully!   === Student Management Menu === 1. Add Student 2. Display All Students 3. Search Student by Roll […]

Java data structures practice programs

  Traversing in binary tree   int countLeafNodes(Node root) { if(root==null) return 0;   Stack<Node> stack=new Stack<>(); stack.push(root); int leafcount=0;   while(!stack.isEmpty()) { Node current=stack.pop();   if(current.left==null && current.right==null) leafcount++; if(current.right!=null) stack.push(current.right); if(current.left!=null) stack.push(current.right); } return leafcount; }

Java data structures Breadth first search

BFS(Breadth First search)   –>also called as level order traversal(where you can visit nodes level by level from top to bottom and left to right)   class Node { int key; Node left,right;   Node(int item)//item=1 { key=item; left=right=null; } } class Breadth { Node root;   public void bfstraversal(Node root) { if(root==null) return;   […]

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer