This is practice problems to learn various data structures and algorithms.
Link list functions implemented:
- void printlist
- void push(int data)
- void insertAfter(int data, int pos)
- void insertAfter(int data, Node prev)
- void append(int data)
- void delete(int pos)
- boolean searchRecursive(int i, Node node)
- boolean searchIterative(int i)
- int lengthIterative()
- int lengthRecursive(Node node)
- void swapNodes(int x, int y)
- Node reverseIterative()
- Node reverseRecursively(Node node)
- Node reverseKNodesInGroups(Node head, int k)
- void printMiddleElement()
- void getNthElement(int index)
- void getNthElementFromEnd()
- void countOccurences(int num)
- void deleteList()
- detectLoop()
- void swapInpairsIterative()
- void checkPalindrome()
- void isCircular()
Stack functions implemented:
- boolean isEmpty()
- boolean push(int el)
- int pop()
- void printStack()
SmallProgramPractice.java
- checkArmstrong(int num)
- sumOfAllDigits(int num)
- isAnagram(String s1, String s2)
- countOfUniqChars(String in)
- printOfUniqChars(String in)
BinaryTree.java Basic implemenation of tree BST.java
- BSTNode insert(BSTNode rootNode, int data)
- boolean search(BSTNode rootNode, int data)
- void inOrder(BSTNode rootNode)
- void preOrder(BSTNode rootNode)
- void postOrder(BSTNode rootNode)
- int maxDepth(BSTNode root)
Sorting.java
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- with pivot last element