Posts

Showing posts from February, 2018

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 Con...