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 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; }

Linked list in java data structures

  import java.io.*; import java.util.*;   class Node { int data; Node next;   Node(int d)//50 { data=d;//data=50 next=null; } } class LinkedList { public static void main(String args[]) { Node head=null;   Scanner s=new Scanner(System.in);   Node current=null;   for(int i=1;i<=5;i++)i=5<=5 { System.out.println(“Enter the elements=”);//50 int a=s.nextInt();//a=50   Node n=new Node(a);//create a node inside […]

Java practice programs with example

    Question 2 : Reverse Prefix of Word(Using Stack)   Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.   For […]

Java stack sum of element program

class Customizedstack { private int arr[];//Array to store stack elements private int top; //acts as a cursor for stack private int capacity;//maximum size of stack   Customizedstack(int size)//5 { capacity=size;//5 arr=new int[capacity];//0-4 top=-1; }   public void push(int value)//10 { if(top==capacity-1)//4 { System.out.println(“stack is overflow”); } else { arr[++top]=value; }   }   public int […]

Reversing a string in java

  /*Question 2ú : Reverse Prefix of Word(Using Stack)   Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.ä   For example, […]

Data structures in java

Customized stack { private int arr[];//Array to store stack elements private int top; //acts as a cursor for stack private int capacity;//maximum size of stack   //1.constructor to initialize stack public Customized stack(int size)//size=5 { arr=new int[size]; capacity=size;//capacity=5 top=-1; } //2.method for push operation(inserting data) public void push(int data)//data=20 { if(isFull()) { System.out.println(“stack is full […]

Linear data structure in java

import java.util.*; class Stacksearch { public static void main(String args[]) { Stack<String> s=new Stack<>();   //push the elements(inserting elements)   s.push(“Apple”); s.push(“Banana”); s.push(“cherry”);   System.out.println(“the elements are: +s);   String searchelement=”cherry”;   int position=s.search(searchelement);   if(position != -1) { System.out.println(searchelement +”found at the position(from top)” +position); } else { System.out.println(searchelement +”not found inside the stack”); […]

Java stack in data structures

Stack:   A stack is a linear data structure that follows LIFO(LAST IN FIRST OUT) principle   linear data structure–>where elements are arranged in a sequence order. Every elements will be connected to its previous or next element   Task Description   push(item)———————-Adds an item to the top of the stack   pop()—————————Remove and return […]

Java example programs for practice

A company is validating usernames for its internal employee portal   Every employee enters their full name as a string like “john_123”   your job is to write a program that does the following:   1. Accept a string that represents a username   2. Check if the username (i) contains only lowercase letters, digits […]

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