Posts

Showing posts from 2018

Killer Problems

Quick sort - Inplace partition AtoI and ItoA conversion Base conversion problems Verify if all the characters in a given string are unique or not Remove all the duplicates in a given string - Linked HashSet insertion Sort  Merge Sort Binary Search - recursive and non-recursive Stack - Datastructure - PUSH, POP, PEEK Queues - DataStructure - INSERT, REMOVE, ... Circular Queues - " LInked Lists SLL Linked Lists DLL Linked List XOR based LL  Concatenate two linked lists Reverse a SLL Reverse a DLL Circular SLL Lowest Common ancestor if an any given two nodes 2 sorted arrays of non-repeating integers. Find min(abs(x-y)) Maximum value of continours sub sequence Kadane Algorithm Given repeated sorted array and a number, Tell its first and last idex  Reverse the words in a given sentence Find an element in rotated binary sorted array Find an element that is repeated more than n/2 times Implement power function (a)b Check if a given linked list is cyclic or

Enable SSL/TLS on your website

Enable SSL/TLS on your website using keytool "keytool" command helps you to drive through the complete process of enabling SSL/TLS for your website. I will be talking only JKS (Java Key Store) which can be used for Java based servers like apache tomcat...  These steps should get you going :   1. Generate a key pair - private and public key(cert) along with Keystore (JKS file) keytool -genkey - alias my_alias -keyAlg RSA -keystore /home/me/mykeystore.jks -keysize 2048 This should ask you bunch of questions like : keystoreFirst name, last name, Organizational unit, Organization, City or Locality and 2 digit country code. The above step should create a file named ' mykeystore.jks ' in the directory you specified. In my case, its /home/me/mykeystore.jks. You can list the contents of this JKS file via 'keytool' command by executing below: keytool -list -keystore /home/me/mykeystore.jks   2. Generate a CSR - Certificate Signed Request for existing

Practice Coding problems on Heaps

Practice Problems on Heaps Max Heaps Min Heaps Priority Queues - Max / Min  Heap Sort (Out of place / In place)  Check if a given array represent min/max heap or not Check if a given binary tree repesents min/max heap or not Print all the elements in sorted order from row and column wise sorted matrix Convert max heap to min heap in linear time Find kth largest/smallest element in a given array Merge ‘k’ sorted lists each containing ‘n’ elements External merge sort Huffman coding Convert BST to min heap  Extended (Advanced) Sort numbers, such that each number is stored in a different machine Number of ways to form a heap with ‘n’ distinct integers Smallest/Largest derangement of sequence Print all the nodes less than value ‘x’ in a min heap Leftist Heap Median of stream of running integers Binomial heaps Connect n ropes with min cost

Interesting Problems on Binary Trees

Binary Trees A good set of 25 interesting problems that touch various aspects of Binary Trees. Solving these should definitely increase your confidence on B trees. Lowest Common Ancestor in a Binary tree Distance between two nodes in a tree Reverse level order traversal Print left/right/top view of binary tree Check if a binary tree is complete or not Check if a binary tree is balanced or not Diameter of a given binary tree Determine if a given binary tree is sub tree or not Print common nodes on path from root (or common ancestors) Inorder successor of a given node in Binary tree/ Successor of all nodes ? Print root to leaf paths in a binary tree  one per line Boundary traversal of Binary Tree Construct Tree from Inorder and Preorder/Postorder Construct Tree from Inorder and Level order ? Construct a binary tree from Linked list Convert a binary tree to Double linked list Convert a binary tree to its mirror tree / Check if two trees are mirror Convert