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

Java practice programs for leetcode

Given an integer array nums[], rotate the array to the right by k steps, where k is non-negative.   Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4]   ————————————————– class […]

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: 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 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;   […]

Java data structures in binaru tree

Binary Tree: –>Binary tree is a hierarchical data structure where each node has at most 2 children left child and right child   Tree Terminology:   Node: An element in the tree. It contains data and links   Root: The topmost node in the tree(No parent)   Parent: A Node that has children   Child: […]

java data structures node insertion simple program

Insert the node at middle(value,position)   public void insertAtposition(int pos, int val)//pos=2, val=52 { Node newNode=new Node(val);   Node temp=head;   for(int i=1; i<pos; i++)i=2;2<2 { temp =temp.next; } newNode.next=temp.next; temp.next=newNode; }

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