Skip to content

Instantly share code, notes, and snippets.

import java.util.HashMap;
import java.util.Map;
class Question2 {
public static final int MAX_UNICODE = 65_535;
public static void main(String[] args) {
System.out.println(checkWhetherStringIsUnique("Competitive Programming"));
}
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();
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();
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.Scanner;
class Stack{
char arr[];
int topOfStack;
char temp;
public Stack(int size){
arr = new char[size];
topOfStack=-1;
}
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;
@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;
@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;