/Programming

programming in java and javascript

Primary LanguageJava

Interview

  • fibonacci
  • revers the num
  • seach element in rotated sorted array and return the index
  • remove duplicate from array and sort them using any inbuilt fuction
  • 3[ab]1[a]4[c] output=abababacccc
  • arr={-1, 5, 6, -3 , 1 , 4 , 3 , 2 , 7 , 1} find whose sum is 7 output=[4,3],[6,1]
  • Spiral Matrix
  • longest palindromic Substring
  • Add Digits
  • Find frequecncy of each element fron am array
  • Rotate Array k=3 from left to right

Basic Maths

  • fizz buzz (easy)
  • even odd (easy)
  • reverse the number (Inportant)
  • prime number
  • fibonacci (Most Important)
  • angstrom number
  • factorial
  • happy numbers

PATTERN

star

  • right angle
  • right angle + hollow
  • left angle
  • triangle
  • triangle + hollow

STRING

  • Reverse String
  • vowels and consonats
  • palindrome
  • Anagram

Sorting Algorithm

  • Selection Sort
  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Insertion Sort

Searching Algorithm

  • Linear Search
  • Binary Search

ARRAY

  • search num in roatated sorted array
  • remove duplicate from array
  • next greater element
  • maximum subarray

2D Array

  • N Traversal in all directions
  • zigzag in all directions

ArrayList

StringBuilder

HashMap

  • occurence of character in String
  • find the frequency of each element

Two Pointers

  • Next Greater Element

Sliding Window

  • maximum subarray

Stack

  • print stack
  • reduce string
  • balanced parenthesis
  • Next Greater Element
  • implenement queue using stack

Queue

implemnt statck using queue

LinkedList

  • add one to linked list
  • Traverse a linkedList
  • Reverse a Listeked List
  • Add new element at end
  • add new element at bignning
  • sort the linked list

Target

CODECRAKERS ARRAY

total => 20

  • Input
  • Linear Search
  • Binary Search
  • Largest Number
  • Smallest Number
  • Reverse Array
  • InsertElement
  • DeleteElement
  • MergeTwoArrays
  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Common Element
  • Count Even Odd
  • Input2D
  • Add Matrices
  • Sub Matrices
  • Transpose Matrices
  • Mul Matrices
  • Input3D

CODECRAKERS STRING

total => 26

  • print the string
  • print the lenght of string
  • Reverse String
  • delete vowels
  • Balanced Parentheses

INTERVIEW QUESTIONS

total => 2

  • find the quoitent and Remainder without using % and /
  • fibonacci series
  • prime Number
  • armstrong Number
  • Reverse Number

LeetCode MANISH

total => 29

  • Fibonacci Number
  • Maximum Subarray
  • Search in Roated Sorted Array -> Linear and Binary Search
  • Remove Duplicate Letters -> HashMap + StringBuilder
  • Two Sum -> BruteForce, HashMap and Two Pointer

LeetCode Playground

total => 3

GITHUB

total => 10

  • fizz-buzz
  • prime Number
  • palindrome Number
  • Anagram Number
  • Power of Two
  • Bubble Sort
  • Quick Sort
  • Balanced Parenthesis
  • find Duplicate in array
  • matrix rotaion

Completd

  • FizzBuzz #

  • EvenOdd #

  • ReverseNum

  • PalindromeNum

  • PrimeNum

  • ArmstrongNum

  • Factorial #

  • Fibonnaci

  • ReverseString

  • PalindromeString

  • Vowels

  • OccurenceOfLetter #

  • OccurenceOfWord #

  • Anagram

  • Selction Sort

  • Bubble Sort

  • Quick Sort

  • Merge Sort

  • Insertion Sort

  • Liner Search

  • Binary Search

  • Maximum Area

  • Maximum Subarray

Complexity

Time Complexity

  • O(log n) => Binary Search
  • O(n)
  • O(nlog(n))
  • O(n^2)

Space Complexity

  • O(1)
  • O(log(n))
  • O(n)

/* 1- Arrays.sort(); // short array

2- Arrays.equals(arr1,arr2); // return boolean value

3- str1.equals(str2); // retun boolean value

4- str1.toCharArray(); //store in char[]

5- str.charAt(i); // store in char

6- str.length();

7- arr.length;

8- (str1.comapareTo(str2) > or < or == 0)>; // return integer value positive negative or 0(if equals)

9- collections.sort(people); // sort object

10- String.valueOf(str) //store in String

11- concat // store in String

12- str.replaceAll(regex:[^0-9],replacemt:"") // store in String

14- str.split(regex:" ") // store in String arr[]

15- Integer.valueOf(str) //store in int

16- Arrays.toString(arr) // human read able form String[] int[] double[] and type of array

*/

/* HashMap

containsKey get put */