Skip to content

Instantly share code, notes, and snippets.

@akashkumarcs19
akashkumarcs19 / StudentArrayMain.java
Created June 23, 2021 05:28
Non_primitive_dataarray_main
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();
@akashkumarcs19
akashkumarcs19 / StudentArray.java
Created June 23, 2021 05:15
Nonprimitive_data_type_array
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;
@akashkumarcs19
akashkumarcs19 / PalLinkedList.java
Created March 3, 2021 17:11
InsertionOnAParticularPositionInSL
class Node {
int data;
Node next;
Node(int data ){
next = null;
this.data = data;
}
}
public class PalLinkedList {
Node head;
class Queue1 {
static Node head;
Node beginning = null;
Node topOfQueue = null;
static class Node {
int data;
Node next;
class Queue1 {
static Node head;
Node beginning = null;
Node topOfQueue = null;
static class Node {
int data;
Node next;
class Queue1 {
static Node head;
Node beginning = null;
Node topOfQueue = null;
static class Node {
int data;
Node next;
import java.util.Scanner;
class Stack{
char arr[];
int topOfStack;
char temp;
public Stack(int size){
arr = new char[size];
topOfStack=-1;
}
class LinkedList{
static Node head;
static class Node{
int data;
Node next;
public Node(int data){
this.data = data;
this.next = null;
}
}
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();
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();