This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Scanner; | |
public class StudentArrayMain { | |
public static void main(String[] args) { | |
StudentArray studentArray = new StudentArray(); | |
studentArray.insert("akash",1,1); | |
studentArray.traverse(); | |
studentArray.deleteindex(0); | |
studentArray.traverse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class StudentArray { | |
Scanner sc = new Scanner(System.in); | |
int rollno; | |
String name; | |
public StudentArray(int rollno, String name) { | |
this.rollno = rollno; | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
int data; | |
Node next; | |
Node(int data ){ | |
next = null; | |
this.data = data; | |
} | |
} | |
public class PalLinkedList { | |
Node head; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Queue1 { | |
static Node head; | |
Node beginning = null; | |
Node topOfQueue = null; | |
static class Node { | |
int data; | |
Node next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Queue1 { | |
static Node head; | |
Node beginning = null; | |
Node topOfQueue = null; | |
static class Node { | |
int data; | |
Node next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Queue1 { | |
static Node head; | |
Node beginning = null; | |
Node topOfQueue = null; | |
static class Node { | |
int data; | |
Node next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class Stack{ | |
char arr[]; | |
int topOfStack; | |
char temp; | |
public Stack(int size){ | |
arr = new char[size]; | |
topOfStack=-1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinkedList{ | |
static Node head; | |
static class Node{ | |
int data; | |
Node next; | |
public Node(int data){ | |
this.data = data; | |
this.next = null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
class Duplicates { | |
public static Map<Character, Integer> countDuplicateCharacters(String string) { | |
var resultMap = new HashMap<Character, Integer>(); | |
var tempMap = new HashMap<Character,Integer>(); | |
// write your code here ... | |
string= string.toUpperCase(); | |
char [] temp=string.toCharArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Scanner; | |
class Anagram { | |
public static void main(String[] args) { | |
Scanner s = new Scanner(System.in); | |
System.out.println("Enter the First string: "); | |
String st = s.nextLine(); | |
System.out.println("Enter the Second string: "); | |
String s1 = s.nextLine(); |
NewerOlder