This is my solution to challenge “Linked Lists: Detect a Cycle” on HackerRank. Click here to see the challenge. /* Detect a cycle in a linked list. Note that the head pointer may be 'null' if the list is empty. A Node is defined as: class Node...
This is my solution to challenge “Queues: A Tale of Two Stacks” on HackerRank. Click here to see the challenge. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static...
This is my solution to challenge “Stacks: Balanced Brackets” on HackerRank. Click here to see the challenge. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static HashMap<...
This is my solution to challenge “Hash Tables: Ransom Note” on HackerRank. Click here to see the challenge. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void...
This is my solution to challenge “Strings: Making Anagrams” on HackerRank. Click here to see the challenge. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int...
This is my solution to challenge “Trees: Is This a Binary Search Tree?” on HackerRank. Click here to see the challenge. import java.io.*; /* Hidden stub code will pass a root argument to the function below. Complete the function to solve the challenge....
This is my solution to challenge about Arrays left rotation. Click here to see the challenge. import java.io.*; import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void...
This is my solution to challenge about the “Tries” data structure. Click here to see the challenge. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; class Node{ Node[] children = new...
Big O is one of the most asked questions in technical interviews. It is the upper bound of the run time of an algorithm and is one of the most commonly used criteria to check the efficiency of an algorithm. In general big O is taken as the “minimum upper...