5fbf6934f7
For a given number N check if it is prime or not. A prime number is a number which is only divisible by 1 and itself. Example 1: Input: N = 5 Output: 1 Explanation: 5 has 2 factors 1 and 5 only. PR Checklist: My submission is formatted according to the guidelines in the contributing guide My addition is on refer on the language README.md file My addition does not have a spelling problem My submission has a proper and user-friendly description of the algorithm My submission has the time complexity of the algorithm My submission has sample input-output of the program (NOT FOR PYTHON) What kind of change does this PR introduce? (check at least one) Bugfix New algorithm Optimization in previous algorithms Code style update Refactor Documentation Other, please describe: Briefly describe the changes in this PR code added for longest palindromic substring |
||
---|---|---|
.. | ||
Maths | ||
arrays | ||
backtracking | ||
bit-manipulation | ||
graphs | ||
linked-lists | ||
queues | ||
recursion | ||
scheduling | ||
searching | ||
sorting | ||
stacks | ||
strings | ||
trees | ||
README.md |
README.md
Java
Arrays
- Counting Inversions
- Kadanes Algorithm
- Left Rotation
- Unique Digits of Large Number
- Majority Element
- Longest Consecutive Subsequence
- K-th Element of Two Sorted Arrays
- Trapping Rain Water
- Ugly Number
- Merge Without Extra Space
Graphs
Linked Lists
Maths
- Factorial
- Nth-Fibonacci
- Catalan Numbers
- Nth Geek Onacci Number
- Random Node in Linked List
- Square Root using BinarySearch
- Roman Numerals Conversion
Queues
Scheduling
Searching
- Binary Search
- Jump Search
- Linear Search
- Allocate minimum number of pages
- Exponential Search
- Interpolation Search
- Ternery Search
Sorting
- Bubble Sort
- Counting Sort
- Heap Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Selection Sort
- Shell Sort
- Cyclic Sort
Stacks
- Balanced Parenthesis
- Stack
- The Stock Span Problem
- Celebrity Problem
- Sliding Window Maximum
- Min Stack
- Next Greater Element
Strings
- KMP
- Palindrome
- Rabin Krap
- Sequence
- Split String
- Tokenizer
- Anagram
- Longest Common Substring
- Boyer Moore Search
- Reverse String
- First Non Repeating Character
- Isomorphic Strings
Trees
- Pre in Post Traversal
- Left View of a Tree
- Right View of a Tree
- Zig-Zag Traversal of a Tree
- Min Heap
- Check Tree Traversal
- Random Node of a binary tree
- Left Leaf Sum of a Binary tree
Backtracking
Bit Manipulation
Recursion
- Array sorted or not
- Sum of all the elements in the array
- Binary search using recursion
- Factorial of a number
- First uppercase letter in a string
- Linear search using recursion
- Minimum and maximum element in the array
- Printing 1 to N and N to 1
- Print PI value in the string
- Reverse the string
- Find the length of the string