SYMBOL INDEX (2811 symbols across 637 files) FILE: C++/Arrays/Trapping the rain water.cpp function trapped_water (line 4) | int trapped_water(int array[],int size){ function main (line 20) | int main(){ FILE: C++/Bit Manipulation/Checking Whether K-th Bit is Set or Not.cpp function main (line 3) | int main(){ FILE: C++/Bit Manipulation/Clearing the K-th bit of a number.cpp function main (line 3) | int main(){ FILE: C++/Bit Manipulation/Setting the K-th bit of a number.cpp function main (line 3) | int main(){ FILE: C++/Bit Manipulation/Toggling Rightmost Set Bit of a number.cpp function main (line 3) | int main(){ FILE: C++/Bit Manipulation/Toggling the K-th bit of a number.cpp function main (line 3) | int main(){ FILE: C++/Dynamic Programming/Edit Distance.cpp function editDistance (line 1) | int editDistance(string s1, string s2){ FILE: C++/Dynamic Programming/Longest Common Subsequence.cpp function lcs (line 1) | int lcs(string x,string y){ FILE: C++/Dynamic Programming/Longest Common Substring.cpp function longest_common_substring (line 4) | int longest_common_substring(string x,string y){ function main (line 26) | int main(){ FILE: C++/Dynamic Programming/Longest Increasing Subsequence.cpp function lis (line 1) | int lis(int array[],int n){ FILE: C++/Dynamic Programming/Longest palindromic Subsequence.cpp function longest_palindromic_subsequence (line 3) | int longest_palindromic_subsequence(string str){ function main (line 22) | int main(){ FILE: C++/Dynamic Programming/Matrix Chain Multiplication.cpp function mcm (line 1) | int mcm(int p[], int n){ FILE: C++/Graph Algorithms/All Pair Shortest Path Problem.cpp function floydWarshall (line 5) | void floydWarshall(vector> &graph){ function main (line 15) | int main(){ FILE: C++/Graph Algorithms/Breadth First Search.cpp function breadth_first_search (line 6) | void breadth_first_search(vector> graph,int src){ function main (line 21) | int main(){ FILE: C++/Graph Algorithms/Connected Components Algorithm DFS.cpp function connectedComponentsDFS (line 6) | void connectedComponentsDFS(vector> graph,int src,vector... function connectedComponents (line 15) | int connectedComponents(vector> graph){ function main (line 27) | int main(){ FILE: C++/Graph Algorithms/Depth First Search.cpp function depth_first_search (line 6) | void depth_first_search(vector> graph,int src){ function main (line 21) | int main(){ FILE: C++/Graph Algorithms/Kruskal's Minimum Spanning Tree Algorithm.cpp type edge (line 6) | struct edge{int src,des,weight;} class UnionFind (line 8) | class UnionFind { method UnionFind (line 11) | UnionFind(){ method UnionFind (line 13) | UnionFind(int size){ method resize (line 20) | void resize(int size){ method find (line 27) | int find(int element){ method connected (line 35) | bool connected(int x,int y){ method merge (line 43) | void merge(int x,int y){ method clear (line 59) | void clear(){ method size (line 62) | int size(){ function comparator (line 66) | bool comparator(const edge &a,const edge &b){ function kruskalsAlgorithm (line 70) | vector kruskalsAlgorithm(vectorgraph,int vertices){ function main (line 84) | int main(){ FILE: C++/Graph Algorithms/Prims Minimum Spanning Tree Algorithm.cpp class edge (line 10) | class edge{ public: int src,des,weight; edge(){}edge(int s,int d,int w):... method edge (line 10) | edge(){} method edge (line 10) | edge(int s,int d,int w): src(s),des(d),weight(w){} class compare (line 11) | class compare { public: bool operator()(const edge &a,const edge &b){ re... function primsAlgorithm (line 13) | vector primsAlgorithm(vector>> graph,edge minEd... function main (line 29) | int main(){ FILE: C++/Graph Algorithms/Recursive Depth First Search.cpp function depth_first_search (line 5) | void depth_first_search(vector> graph,int src,vector &vi... function main (line 14) | int main(){ FILE: C++/Graph Algorithms/Single Shortest Path Bellman Ford Algorithm.cpp type edge (line 6) | struct edge {int src, des, weight;} function bellmanFord (line 8) | pair> bellmanFord(vector graph,int vertex,int sou... function main (line 26) | int main(){ FILE: C++/Graph Algorithms/Single Source Shortest Path Dijkstra Algorithm.cpp type compare (line 7) | struct compare{ function dijkshtra (line 12) | vector dijkshtra(vector>> graph,int src){ function main (line 33) | int main(){ FILE: C++/Graph Algorithms/Topological Sorting.cpp function topologicalSortDFS (line 6) | void topologicalSortDFS(vector> graph,int src,vector &vi... function topologicalSort (line 16) | list topologicalSort(vector> graph){ function main (line 25) | int main(){ FILE: C++/Heaps - Priority Queues/K-th Largest element of the stream.cpp function main (line 5) | int main(){ FILE: C++/Linked List/Reverse a linked list recursively.cpp function reverse_list (line 1) | void reverse_list(list_node *head){ FILE: C++/Number Theory Algorithms/Divisors.cpp function generateDivisors (line 4) | set generateDivisors(long long int num){ function main (line 16) | int main(){ FILE: C++/Number Theory Algorithms/Sieve of Eratosthenes.cpp function seiveEratosthenes (line 11) | int seiveEratosthenes(){ function main (line 22) | int main(){ FILE: C++/Recursion/Partition of array on the pivot.cpp function partition (line 3) | void partition(int array[],int low,int high){ function main (line 13) | int main(){ FILE: C++/Recursion/Permutation of a string.cpp function permutation (line 4) | void permutation(char str[],int k,int n){ function main (line 19) | int main(){ FILE: C++/Segment Tree/Segment Tree.cpp function buildTree (line 1) | void buildTree (int tree[],int array[], int index, int low, int high) { function rangeQuery (line 11) | int rangeQuery (int tree[],int index, int low, int high, int l, int r) { function updateQuery (line 20) | void updateQuery (int tree[],int index, int low, int high, int pos, int ... FILE: C++/Stacks - Queue/CircularQueue.cpp class circular_queue (line 3) | class circular_queue function main (line 59) | int main(){ FILE: C++/String Algorithms/KMP.cpp function computePrefix (line 1) | vector computePrefix(string pat){ function KMP (line 17) | void KMP(string str,string pat){ FILE: C++/String Algorithms/Trie.cpp type Trie (line 1) | struct Trie { method Trie (line 5) | Trie() { method pushWord (line 10) | void pushWord(char *str) { method wordExist (line 21) | bool wordExist(char* str) { method prefixExist (line 32) | bool prefixExist(char* str) { FILE: C++/Union Find/Union Find.cpp class UnionFind (line 4) | class UnionFind { method UnionFind (line 7) | UnionFind(){ method UnionFind (line 9) | UnionFind(int size){ method resize (line 16) | void resize(int size){ method find (line 23) | int find(int element){ method connected (line 31) | bool connected(int x,int y){ method merge (line 39) | void merge(int x,int y){ method clear (line 55) | void clear(){ method size (line 58) | int size(){ function main (line 64) | int main(){ FILE: python/array/arrayaddition.py function add (line 1) | def add(arr1, arr2): FILE: python/array/commonthreesortedarray.py function common_elements (line 3) | def common_elements(input1, input2, input3): FILE: python/array/countinversionofsize3.py function find_inversions (line 3) | def find_inversions(input): FILE: python/array/flip0smaximum1s.py function flip_0s_to_maximize_consecutive_1s (line 3) | def flip_0s_to_maximize_consecutive_1s(input, flips_allowed): FILE: python/array/longestsamesumspan.py function longest_span (line 4) | def longest_span(input1, input2): FILE: python/array/maximumsumpathtwoarrays.py function max_sum (line 3) | def max_sum(input1, input2): FILE: python/array/maxproductsubarray.py function max_product (line 3) | def max_product(input): FILE: python/array/numberoftrianglesunsortedarray.py function number_of_triangles (line 3) | def number_of_triangles(input): FILE: python/array/positiveandnegativealternativelymaintainingorder.py function rearrange (line 3) | def rearrange(input): function find_next (line 18) | def find_next(input, start, isPositive): function right_rotate (line 24) | def right_rotate(input, start, end): FILE: python/array/rearrangearrayperindex.py function rearrange (line 3) | def rearrange(input): function rearrange_util (line 14) | def rearrange_util(input, start): FILE: python/array/reorderarraybyindex.py function reorder (line 3) | def reorder(input, index): FILE: python/array/rotationwithmaxsum.py function max_sum (line 3) | def max_sum(input): FILE: python/array/smallestintegernotrepresentedbysubsetsum.py function find_smallest_integer (line 3) | def find_smallest_integer(input): FILE: python/array/tripletsumlessthantotal.py function find_all_triplet (line 3) | def find_all_triplet(input, total): FILE: python/array/zigzagarrangement.py function rearrange (line 3) | def rearrange(input): function swap (line 14) | def swap(input, i, j): FILE: python/dynamic/bitonicsequence.py function longest_bitonic (line 22) | def longest_bitonic(sequence): FILE: python/dynamic/boxstacking.py function create_rotation (line 37) | def create_rotation(given_dimensions): function sort_by_decreasing_area (line 53) | def sort_by_decreasing_area(rotations): function can_stack (line 57) | def can_stack(box1, box2): function box_stack_max_height (line 61) | def box_stack_max_height(dimensions): FILE: python/dynamic/breakword.py function word_break_recursive (line 30) | def word_break_recursive(given_string, dictionary): function word_break_dp (line 47) | def word_break_dp(given_string, dictionary): function is_word_break_possible (line 86) | def is_word_break_possible(given_string, dictionary): function is_word_break_possible_recursive_helper (line 94) | def is_word_break_possible_recursive_helper(given_string, dictionary, st... function all_possible_word_break_helper (line 114) | def all_possible_word_break_helper(given_string, dictionary, start, max_... function all_possible_word_breaks (line 137) | def all_possible_word_breaks(given_string, dictionary): FILE: python/dynamic/coin_change_num_ways.py function coin_changing_num_ways (line 22) | def coin_changing_num_ways(coins, total): function coin_changing_num_ways2 (line 39) | def coin_changing_num_ways2(coins, total): function print_coin_changes_recursive (line 54) | def print_coin_changes_recursive(coins, total, results_stack, pos): function print_coin_changes (line 67) | def print_coin_changes(coins, total): FILE: python/dynamic/coinchangingmincoins.py function min_coins (line 22) | def min_coins(coins, total): function print_coins (line 37) | def print_coins(R, coins): function min_coins2 (line 51) | def min_coins2(coins, total): function min_coins_top_down (line 68) | def min_coins_top_down(coins, total, memo): FILE: python/dynamic/count_num_A.py function count_a_recursive (line 30) | def count_a_recursive(n_times): function count_a (line 42) | def count_a(n_times): FILE: python/dynamic/count_num_binary_without_consec_1.py function consec_one (line 28) | def consec_one(num_n): FILE: python/dynamic/cutting_rod.py function max_profit_dp (line 26) | def max_profit_dp(prices, rod_length): function max_profit_recursive (line 41) | def max_profit_recursive(prices, rod_length): FILE: python/dynamic/dice_throw_ways.py function num_ways (line 21) | def num_ways(faces, dices, sumX): FILE: python/dynamic/editdistance.py function print_edits (line 23) | def print_edits(T, str1, str2): function min_edit_distance (line 44) | def min_edit_distance(str1, str2): function min_edit_distance_recursive (line 65) | def min_edit_distance_recursive(str1, str2): FILE: python/dynamic/egg_drop.py function min_attempts_egg_drop (line 27) | def min_attempts_egg_drop(eggs, floors): function min_attempts_egg_drop_recursive (line 40) | def min_attempts_egg_drop_recursive(eggs, floors): FILE: python/dynamic/knapsack_01.py function knapsack_01 (line 25) | def knapsack_01(values, weights, total): function knapsack_01_recursive_util (line 43) | def knapsack_01_recursive_util(values, weights, remaining_weight, total_... function knapsack_01_recursive (line 62) | def knapsack_01_recursive(values, weights, total_weight): FILE: python/dynamic/kth_ugly_number.py function ugly_number (line 22) | def ugly_number(kth): FILE: python/dynamic/longest_common_subsequence.py function lcs_recursive_helper (line 27) | def lcs_recursive_helper(sequence1, sequence2, index1, index2): function longest_common_subsequence_recursive (line 38) | def longest_common_subsequence_recursive(sequence1, sequence2): function longest_common_subsequence (line 42) | def longest_common_subsequence(sequence1, sequence2): FILE: python/dynamic/longest_common_substring.py function longest_common_string_recursive_helper (line 26) | def longest_common_string_recursive_helper(str1, str2, pos1, pos2, check... function longest_common_substring_recursive (line 45) | def longest_common_substring_recursive(str1, str2): function longest_common_substring (line 49) | def longest_common_substring(str1, str2): FILE: python/dynamic/longest_increasing_subsequence.py function longest_increasing_subsequence (line 30) | def longest_increasing_subsequence(sequence): function longest_increasing_subsequence_recursive (line 61) | def longest_increasing_subsequence_recursive(sequence): function longest_subsequence_recursive_helper (line 73) | def longest_subsequence_recursive_helper(sequence, next_position, curren... FILE: python/dynamic/longest_palindromic_subsequence.py function longest_palindromic_subsequence (line 23) | def longest_palindromic_subsequence(given_string): function palindromic_subsequence_recursive_helper (line 45) | def palindromic_subsequence_recursive_helper(given_string, start_index, ... function longest_palindromic_subsequence_recursive (line 56) | def longest_palindromic_subsequence_recursive(given_string): FILE: python/dynamic/matrix_chain_order.py function matrix_chain_order (line 32) | def matrix_chain_order(matrices): FILE: python/dynamic/maximum_increasing_subsequence.py function maximum_sum_subsequence (line 25) | def maximum_sum_subsequence(sequence): FILE: python/dynamic/nth_fibonacci.py function fibonacci_recursive (line 20) | def fibonacci_recursive(n): function fibonacci (line 27) | def fibonacci(n): FILE: python/dynamic/num_bst.py function num_bst (line 23) | def num_bst(num_nodes): function num_bst_recursive (line 35) | def num_bst_recursive(num_nodes): FILE: python/dynamic/num_paths_nm_matrix.py function num_paths_matrix (line 21) | def num_paths_matrix(rows, cols): function num_paths_matrix_recursive (line 29) | def num_paths_matrix_recursive(rows, cols): FILE: python/dynamic/num_trees_preorder.py function num_trees (line 19) | def num_trees(num_nodes): function num_trees_recursive (line 29) | def num_trees_recursive(num_nodes): FILE: python/dynamic/optimal_bst.py function min_cost_bst (line 24) | def min_cost_bst(input_array, freq): function min_cost_bst_recursive_helper (line 43) | def min_cost_bst_recursive_helper(input_array, freq, low_index, high_ind... function min_cost_bst_recursive (line 57) | def min_cost_bst_recursive(input_array, freq): FILE: python/dynamic/stockbuysellktransactions.py function max_profit (line 20) | def max_profit(prices, K): function max_profit_slow_solution (line 42) | def max_profit_slow_solution(prices, K): function print_actual_solution (line 63) | def print_actual_solution(T, prices): FILE: python/dynamic/string_interleaving.py function is_interleaved_recursive (line 14) | def is_interleaved_recursive(str1, str2, str3, pos1, pos2, pos3): function is_interleaved (line 25) | def is_interleaved(str1, str2, str3): FILE: python/dynamic/sub_rectangular_maximum_sum.py function kadanes (line 37) | def kadanes(temp): function max_sub_sub_rectangle (line 59) | def max_sub_sub_rectangle(rectangle): FILE: python/dynamic/subset_sum.py function subset_sum (line 27) | def subset_sum(sequence, sum_value): function partition (line 45) | def partition(sequence): FILE: python/dynamic/symbolexpressionevaluation.py function evaluate_expression (line 19) | def evaluate_expression(expression_map, expression, result): FILE: python/dynamic/weighted_job_scheduling_max_profit.py function can_sequence (line 24) | def can_sequence(job1, job2): function find_max_profit (line 30) | def find_max_profit(jobs): FILE: python/geometry/skylinedrawing.py class BuildingPoint (line 3) | class BuildingPoint(object): method __init__ (line 5) | def __init__(self, point, is_start, height): method __lt__ (line 10) | def __lt__(self, other): function get_skyline (line 26) | def get_skyline(buildings): FILE: python/graph/cycledirectedgraph.py function has_cycle (line 6) | def has_cycle(graph): function dfs (line 21) | def dfs(current, white, gray, black): function move_vertex (line 34) | def move_vertex(vertex, source_set, destination_set): FILE: python/graph/cycleundirectedgraph.py function has_cycle_dfs (line 7) | def has_cycle_dfs(graph): function has_cycle_dfs_util (line 17) | def has_cycle_dfs_util(vertex, visited, parent): function has_cycle_using_disjoint_set (line 29) | def has_cycle_using_disjoint_set(graph): FILE: python/graph/dijkstrashortestpath.py function shortest_path (line 10) | def shortest_path(graph, sourceVertex): function get_other_vertex_for_edge (line 43) | def get_other_vertex_for_edge(vertex, edge): FILE: python/graph/disjointset.py class Node (line 4) | class Node(object): method __init__ (line 6) | def __init__(self, data, parent = None, rank = 0): method __str__ (line 11) | def __str__(self): method __repr__ (line 14) | def __repr__(self): class DisjointSet (line 18) | class DisjointSet(object): method __init__ (line 20) | def __init__(self): method make_set (line 23) | def make_set(self, data): method union (line 28) | def union(self, data1, data2): method find_set (line 45) | def find_set(self, data): method find_set_util (line 48) | def find_set_util(self, node): FILE: python/graph/floydwarshall.py class NegativeWeightCycleException (line 7) | class NegativeWeightCycleException(Exception): method __init__ (line 8) | def __init__(self): function all_pair_shortest_path (line 11) | def all_pair_shortest_path(distance_matrix): function print_path (line 45) | def print_path(path, start, end): FILE: python/graph/fordfulkerson.py function max_flow (line 6) | def max_flow(capacity, source, sink): function bfs (line 38) | def bfs(residual_capacity, source, sink): FILE: python/graph/graph.py class Graph (line 4) | class Graph(object): method __init__ (line 6) | def __init__(self, is_directed): method add_edge (line 11) | def add_edge(self, id1, id2, weight=0): class Edge (line 31) | class Edge(object): method __init__ (line 33) | def __init__(self, vertex1, vertex2, is_directed, weight): method __eq__ (line 39) | def __eq__(self, other): method __hash (line 42) | def __hash(self): method __str__ (line 45) | def __str__(self): method __repr__ (line 48) | def __repr__(self): class Vertex (line 51) | class Vertex(object): method __init__ (line 53) | def __init__(self, id): method add_adjacent_vertex (line 58) | def add_adjacent_vertex(self, edge, vertex): method get_degree (line 62) | def get_degree(self): method __eq__ (line 65) | def __eq__(self, other): method __hash__ (line 68) | def __hash__(self): method __str__ (line 71) | def __str__(self): method __repr__ (line 74) | def __repr__(self): method __lt__ (line 77) | def __lt__(self, other): method __gt__ (line 80) | def __gt__(self, other): FILE: python/graph/graphtraversal.py function dfs_util (line 7) | def dfs_util(v, visited): function dfs (line 15) | def dfs(graph): function bfs (line 20) | def bfs(graph): FILE: python/graph/kruskalmst.py function get_key (line 7) | def get_key(edge): function minimum_spanning_tree (line 10) | def minimum_spanning_tree(graph): FILE: python/graph/primmst.py function minimum_spanning_tree (line 8) | def minimum_spanning_tree(graph): function get_other_vertex_for_edge (line 35) | def get_other_vertex_for_edge(vertex, edge): FILE: python/graph/priorityqueue.py class PriorityQueue (line 7) | class PriorityQueue(object): method __init__ (line 9) | def __init__(self, is_min_heap): method contains_task (line 17) | def contains_task(self, task): method get_task_priority (line 23) | def get_task_priority(self, task): method add_task (line 28) | def add_task(self, priority, task): method change_task_priority (line 35) | def change_task_priority(self, priority, task): method remove_task (line 43) | def remove_task(self, task): method pop_task (line 47) | def pop_task(self): method peek_task (line 55) | def peek_task(self): method is_empty (line 63) | def is_empty(self): method __str__ (line 70) | def __str__(self): FILE: python/graph/topologicalsort.py function top_sort (line 6) | def top_sort(graph): function top_sort_util (line 15) | def top_sort_util(vertex, stack, visited): FILE: python/recursion/setpairtogether.py function find_minimum_swaps (line 3) | def find_minimum_swaps(input, pair): function find_minimum_swaps_util (line 9) | def find_minimum_swaps_util(input, pair, index, current): function swap (line 36) | def swap(index, input, i, j): FILE: python/recursion/stringpermutation.py function permute (line 3) | def permute(input): function permute_util (line 20) | def permute_util(str, count, result, level): FILE: python/string/Z_Algorithm.py function z_algo (line 9) | def z_algo(arr): function makepattern (line 33) | def makepattern(string , pattern): FILE: python/string/knuthmorrispratt.py function compute_temporary_array (line 6) | def compute_temporary_array(pattern): function kmp (line 26) | def kmp(text, pattern): FILE: python/string/rabinkarp.py function pattern_matching (line 5) | def pattern_matching(text, pattern): function check_equal (line 19) | def check_equal(str1, str2): function create_hash (line 29) | def create_hash(input, end): function recalculate_hash (line 35) | def recalculate_hash(input, old_index, new_index, old_hash, pattern_len): FILE: python/tree/binary_tree.py class Node (line 6) | class Node: method __init__ (line 7) | def __init__(self): method newNode (line 18) | def newNode(data): class BinaryTree (line 28) | class BinaryTree: method __init__ (line 30) | def __init__(self): method add_head (line 34) | def add_head(data, head): FILE: python/tree/construct_tree_from_inorder_preorder.py class ConstructTreeFromInorderPreOrder (line 4) | class ConstructTreeFromInorderPreOrder: method __init__ (line 5) | def __init__(self): method _createTree (line 8) | def _createTree(self, inorder, preorder, start, end): method createTree (line 22) | def createTree(self, inorder, preorder): FILE: python/tree/fenwick_tree.py class FenTree (line 10) | class FenTree (object): method __init__ (line 11) | def __init__ (self, array): method get_parent (line 16) | def get_parent (self, child): method get_next (line 19) | def get_next (self, index): method update (line 22) | def update (self, index, item): method prefix_sum (line 30) | def prefix_sum (self, index): method range_sum (line 38) | def range_sum (self, x, y): method describe (line 41) | def describe (self): FILE: python/tree/largest_bst_in_binary_tree.py class MinMax (line 26) | class MinMax: method __init__ (line 28) | def __init__(self): class LargestBSTBinaryTree (line 35) | class LargestBSTBinaryTree: method largestBST (line 37) | def largestBST(self, root): method largest (line 41) | def largest(self, root): FILE: python/tree/max_depth_binary_tree.py class Node (line 19) | class Node: method __init__ (line 20) | def __init__(self, value): function find_max_depth (line 40) | def find_max_depth(n): FILE: python/tree/morris_traversal.py class MorrisTraversal (line 19) | class MorrisTraversal: method __init__ (line 21) | def __init__(self): method find_predecessor (line 25) | def find_predecessor(current): method inorder (line 32) | def inorder(root_node): method preorder (line 50) | def preorder(root_node): FILE: python/tree/segmenttreesum.py function create_segment_tree (line 1) | def create_segment_tree(input): function construct_tree (line 7) | def construct_tree(segment_tree, input, low, high, pos): function sum_range_query (line 17) | def sum_range_query(segment_tree, q_low, q_high, len): function sum_range_query_util (line 20) | def sum_range_query_util(segment_tree, low, high, q_low, q_high, pos): function update_value (line 31) | def update_value(input, segment_tree, new_value, index): function update_value_util (line 36) | def update_value_util(segment_tree, low, high, diff, index, pos): function next_power_of_2 (line 48) | def next_power_of_2(n): FILE: src/com/interview/array/AdditiveNumber.java class AdditiveNumber (line 15) | public class AdditiveNumber { method isAdditiveNumber (line 17) | public boolean isAdditiveNumber(String num) { method isValid (line 40) | private boolean isValid(String num, int start, BigInteger x1, BigInteg... FILE: src/com/interview/array/ArrayAddition.java class ArrayAddition (line 3) | public class ArrayAddition { method add (line 5) | public int[] add(int arr1[], int arr2[]){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/array/BestMeetingPoint.java class BestMeetingPoint (line 21) | public class BestMeetingPoint { method minTotalDistance (line 22) | public int minTotalDistance(int[][] grid) { method main (line 56) | public static void main(String args[]) { FILE: src/com/interview/array/BuySellStockProfit.java class BuySellStockProfit (line 17) | public class BuySellStockProfit { method oneProfit (line 19) | public int oneProfit(int arr[]){ method allTimeProfit (line 33) | public int allTimeProfit(int arr[]){ method main (line 43) | public static void main(String args[]){ FILE: src/com/interview/array/CheckIfArrayElementsAreConsecutive.java class CheckIfArrayElementsAreConsecutive (line 6) | public class CheckIfArrayElementsAreConsecutive { method areConsecutive (line 8) | public boolean areConsecutive(int input[]){ method main (line 30) | public static void main(String args[]){ FILE: src/com/interview/array/ChunkMerge.java class ChunkMerge (line 15) | public class ChunkMerge { class Triplet (line 17) | class Triplet implements Comparable{ method compareTo (line 21) | @Override method mergeUsingHeap (line 31) | public List mergeUsingHeap(List> chunks){ method mergeChunksOfDifferentSize (line 55) | public List mergeChunksOfDifferentSize(List> ch... method mergeSort (line 73) | private void mergeSort(List result,int start,int end,int sum[]){ method sortedMerge (line 83) | private void sortedMerge(List result,int start,int end,int su... method main (line 118) | public static void main(String args[]){ FILE: src/com/interview/array/CommonThreeSortedArray.java class CommonThreeSortedArray (line 16) | public class CommonThreeSortedArray { method commonElements (line 18) | public List commonElements(int input1[], int input2[], int in... method main (line 40) | public static void main(String args[]) { FILE: src/com/interview/array/ConvertAnArrayIntoDecreaseIncreaseFashion.java class ConvertAnArrayIntoDecreaseIncreaseFashion (line 10) | public class ConvertAnArrayIntoDecreaseIncreaseFashion { method convert (line 12) | public void convert(int arr[]){ method convert1 (line 37) | public void convert1(int arr[]){ method swap (line 46) | private void swap(int arr[],int low,int high){ method main (line 52) | public static void main(String args[]){ FILE: src/com/interview/array/CountInversionOfSize3.java class CountInversionOfSize3 (line 11) | public class CountInversionOfSize3 { method findInversions (line 17) | public int findInversions(int input[]) { method main (line 37) | public static void main(String args[]) { FILE: src/com/interview/array/CountSmallerOnRight.java class CountSmallerOnRight (line 17) | public class CountSmallerOnRight { class NumberIndex (line 18) | static class NumberIndex { method NumberIndex (line 21) | NumberIndex(int val, int index) { method countSmaller (line 27) | public List countSmaller(int[] nums) { method mergeUtil (line 47) | private void mergeUtil(NumberIndex[] nums, int[] result, int low, int ... method main (line 86) | public static void main(String args[]) { FILE: src/com/interview/array/DivideNumbersInEqualGroupWithClosestSum.java class DivideNumbersInEqualGroupWithClosestSum (line 15) | public class DivideNumbersInEqualGroupWithClosestSum { method divide (line 17) | public void divide(int arr[],List list1, List list2){ method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/array/DuplicateNumberDetection.java class DuplicateNumberDetection (line 13) | public class DuplicateNumberDetection { method findDuplicate (line 14) | public int findDuplicate(int[] nums) { method main (line 34) | public static void main(String args[]) { FILE: src/com/interview/array/DuplicateWithinkIndices.java class DuplicateWithinkIndices (line 10) | public class DuplicateWithinkIndices { method duplicate (line 12) | public boolean duplicate(int arr[],int k){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/array/FindElementsOccurringNByKTimesTetris.java class FindElementsOccurringNByKTimesTetris (line 12) | public class FindElementsOccurringNByKTimesTetris { class Pair (line 14) | public static class Pair{ method printElementsOccurringKTimes (line 19) | public void printElementsOccurringKTimes(int arr[],int k){ method main (line 66) | public static void main(String args[]){ FILE: src/com/interview/array/FirstPositiveMissing.java class FirstPositiveMissing (line 6) | public class FirstPositiveMissing { method firstMissingPositive (line 7) | public int firstMissingPositive(int[] nums) { method segregate (line 23) | private int segregate(int[] nums) { method swap (line 38) | private void swap(int[] nums, int start, int end) { FILE: src/com/interview/array/Flip0sMaximum1s.java class Flip0sMaximum1s (line 15) | public class Flip0sMaximum1s { method flip0sToMaximizeConsecutive1s (line 17) | public int flip0sToMaximizeConsecutive1s(int input[], int flipsAllowed) { method main (line 43) | public static void main(String args[]) { FILE: src/com/interview/array/FourSum.java class FourSum (line 21) | public class FourSum { method fourSum (line 23) | public List> fourSum(int[] nums, int target) { method main (line 82) | public static void main(String args[]) { FILE: src/com/interview/array/GasStationCircle.java class GasStationCircle (line 12) | public class GasStationCircle { method startTour (line 14) | public int startTour(int gasAvailable[],int gasRequired[]){ method startTour1 (line 44) | public int startTour1(int gasAvailable[], int gasRequired[]){ method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/array/GreedyTextJustification.java class GreedyTextJustification (line 19) | public class GreedyTextJustification { method fullJustify (line 20) | public List fullJustify(String[] words, int maxWidth) { method padSpace (line 61) | private void padSpace(StringBuffer buff, int count) { method fullJustify1 (line 67) | public List fullJustify1(String[] words, int maxWidth) { method main (line 131) | public static void main(String args[]) { FILE: src/com/interview/array/GroupElementsInSizeM.java class Pair (line 15) | class Pair{ method Pair (line 18) | Pair(int num,int count){ class Comparators (line 24) | class Comparators implements Comparator{ method compare (line 26) | @Override class GroupElementsInSizeM (line 37) | public class GroupElementsInSizeM { method group (line 39) | public boolean group(int input[],int m){ method main (line 77) | public static void main(String args[]){ FILE: src/com/interview/array/HIndex.java class HIndex (line 8) | public class HIndex { method hIndex (line 9) | public int hIndex(int[] citations) { method main (line 35) | public static void main(String args[]) { FILE: src/com/interview/array/IncreasingSubsequnceOfLength3WithMaxProduct.java class IncreasingSubsequnceOfLength3WithMaxProduct (line 13) | public class IncreasingSubsequnceOfLength3WithMaxProduct { method maxProduct (line 15) | public int maxProduct(int arr[]){ method getLGN (line 47) | private void getLGN(int arr[],int pos,int LGN[]){ method main (line 61) | public static void main(String args[]){ FILE: src/com/interview/array/IncreasingTripletSubsequence.java class IncreasingTripletSubsequence (line 15) | public class IncreasingTripletSubsequence { method increasingTriplet (line 16) | public boolean increasingTriplet(int[] nums) { method main (line 38) | public static void main(String args[]) { FILE: src/com/interview/array/JumpGame.java class JumpGame (line 25) | public class JumpGame { method canJump (line 27) | public boolean canJump(int[] nums) { method jump (line 36) | public int jump(int[] nums) { method main (line 50) | public static void main(String args[]) { FILE: src/com/interview/array/KadaneWrapArray.java class Triplet (line 11) | class Triplet{ method toString (line 15) | @Override class KadaneWrapArray (line 22) | public class KadaneWrapArray { method kadaneWrap (line 24) | public Triplet kadaneWrap(int arr[]){ method kadane (line 49) | public Triplet kadane(int arr[]){ method main (line 75) | public static void main(String args[]){ FILE: src/com/interview/array/KthElementInArray.java class KthElementInArray (line 12) | public class KthElementInArray { method kthElement (line 14) | public int kthElement(int arr[],int k){ method quickSelect (line 32) | private int quickSelect(int arr[],int low,int high){ method swap (line 52) | private void swap(int arr[],int low,int high){ method main (line 58) | public static void main(String args[]){ FILE: src/com/interview/array/KthLargestInTwoSortedArray.java class KthLargestInTwoSortedArray (line 7) | public class KthLargestInTwoSortedArray { method kthLargest1 (line 10) | public int kthLargest1(int arr1[],int arr2[],int low1,int high1,int lo... method kthLargest (line 45) | public int kthLargest(int input1[],int input2[],int k){ method kthLargest (line 49) | private int kthLargest(int input1[],int input2[],int l1, int h1, int l... method main (line 113) | public static void main(String args[]){ FILE: src/com/interview/array/LargerElementOnRight.java class LargerElementOnRight (line 15) | public class LargerElementOnRight { method larger (line 17) | public int[] larger(int input[]){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/array/LargestMountain.java class LargestMountain (line 6) | public class LargestMountain { method longestMountain (line 8) | public int longestMountain(int[] nums) { type State (line 34) | enum State { method main (line 40) | public static void main(String[] args) { FILE: src/com/interview/array/LargestSubArrayWithEqual0sAnd1s.java class LargestSubArrayWithEqual0sAnd1s (line 13) | public class LargestSubArrayWithEqual0sAnd1s { method equalNumber (line 15) | public int equalNumber(int arr[]){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/array/LeetCodeCandy.java class LeetCodeCandy (line 7) | public class LeetCodeCandy { method candy (line 8) | public int candy(int[] ratings) { FILE: src/com/interview/array/LongestConsecutiveSubsequence.java class LongestConsecutiveSubsequence (line 18) | public class LongestConsecutiveSubsequence { method longestConsecutive (line 19) | public int longestConsecutive(int[] nums) { method main (line 38) | public static void main(String args[]) { FILE: src/com/interview/array/LongestIncreasingSubSequenceOlogNMethod.java class LongestIncreasingSubSequenceOlogNMethod (line 15) | public class LongestIncreasingSubSequenceOlogNMethod { method ceilIndex (line 20) | private int ceilIndex(int input[], int T[], int end, int s){ method longestIncreasingSubSequence (line 37) | public int longestIncreasingSubSequence(int input[]){ method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/array/LongestSameSumSpan.java class LongestSameSumSpan (line 18) | public class LongestSameSumSpan { method longestSpan (line 20) | public int longestSpan(int input1[], int input2[]) { method main (line 41) | public static void main(String args[]) { FILE: src/com/interview/array/LongestSubstringWithAtMost2Char.java class LongestSubstringWithAtMost2Char (line 7) | public class LongestSubstringWithAtMost2Char { method lengthOfLongestSubstringTwoDistinct (line 8) | public int lengthOfLongestSubstringTwoDistinct(String s) { method main (line 51) | public static void main(String args[]) { FILE: src/com/interview/array/MaxNumberFromTwoArray.java class MaxNumberFromTwoArray (line 22) | public class MaxNumberFromTwoArray { method maxNumber (line 23) | public int[] maxNumber(int[] nums1, int[] nums2, int k) { method merge (line 37) | private int[] merge(int[] a1, int[] a2) { method isGreater (line 62) | private boolean isGreater(int[] a, int[] b, int i, int j) { method findLargest1 (line 75) | private int[] findLargest1(int[] nums, int k) { method main (line 92) | public static void main(String args[]) { FILE: src/com/interview/array/MaxProductSubarray.java class MaxProductSubarray (line 15) | public class MaxProductSubarray { method maxProduct (line 17) | public int maxProduct(int[] nums) { method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/array/MaxRepeatingNumber.java class MaxRepeatingNumber (line 9) | public class MaxRepeatingNumber { method maxRepeatingNumber (line 11) | public int maxRepeatingNumber(int arr[], int k){ method main (line 30) | public static void main(String args[]){ FILE: src/com/interview/array/MaximumGap.java class MaximumGap (line 15) | public class MaximumGap { class Bucket (line 17) | class Bucket { method update (line 21) | void update(int val) { method maximumGap (line 33) | public int maximumGap(int[] input) { method main (line 73) | public static void main(String args[]) { FILE: src/com/interview/array/MaximumIminusJSuchThatAiGTAj.java class MaximumIminusJSuchThatAiGTAj (line 9) | public class MaximumIminusJSuchThatAiGTAj { class Node (line 11) | class Node{ method maximumGeeks (line 16) | public int maximumGeeks(int input[]){ method main (line 50) | public static void main(String args[]){ FILE: src/com/interview/array/MaximumMinimumArrangement.java class MaximumMinimumArrangement (line 15) | public class MaximumMinimumArrangement { method rearrange (line 17) | public void rearrange(int[] input) { FILE: src/com/interview/array/MaximumOfSubarrayOfSizeK.java class MaximumOfSubarrayOfSizeK (line 14) | public class MaximumOfSubarrayOfSizeK { method maxSubArray (line 16) | public int[] maxSubArray(int input[], int k) { method main (line 56) | public static void main(String args[]){ FILE: src/com/interview/array/MaximumSumPathTwoArrays.java class MaximumSumPathTwoArrays (line 16) | public class MaximumSumPathTwoArrays { method maxSum (line 18) | public int maxSum(int input1[], int input2[]) { method main (line 55) | public static void main(String args[]) { FILE: src/com/interview/array/MaximumSumThreeNonOverlappingSubarray.java class MaximumSumThreeNonOverlappingSubarray (line 11) | public class MaximumSumThreeNonOverlappingSubarray { method maxSumOfThreeSubarrays (line 13) | public int[] maxSumOfThreeSubarrays(int[] nums, int k) { method main (line 60) | public static void main(String[] args) { FILE: src/com/interview/array/MeetingRooms.java class MeetingRooms (line 18) | public class MeetingRooms { class Interval (line 20) | public static class Interval { method Interval (line 23) | Interval() { start = 0; end = 0; } method Interval (line 24) | Interval(int s, int e) { start = s; end = e; } method minMeetingRooms1 (line 27) | public int minMeetingRooms1(Interval[] intervals) { method minMeetingRooms (line 51) | public int minMeetingRooms(Interval[] intervals) { FILE: src/com/interview/array/MinimumDistanceBetweenTwoNumbers.java class MinimumDistanceBetweenTwoNumbers (line 6) | public class MinimumDistanceBetweenTwoNumbers { method minDistance (line 8) | public int minDistance(int input[],int x, int y){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/array/MinimumNumberFromSequence.java class MinimumNumberFromSequence (line 15) | public class MinimumNumberFromSequence { method find (line 17) | public int[] find(char[] input) { method main (line 39) | public static void main(String args[]) { FILE: src/com/interview/array/MinimumSortedWhichSortsEntireArray.java class MinimumSortedWhichSortsEntireArray (line 6) | public class MinimumSortedWhichSortsEntireArray { method minLength (line 8) | public int minLength(int arr[]){ method main (line 49) | public static void main(String args[]){ FILE: src/com/interview/array/MissingRanges.java class MissingRanges (line 15) | public class MissingRanges { method findMissingRanges (line 16) | public List findMissingRanges(int[] nums, int lower, int upper) { method makeRange (line 38) | private String makeRange(int a, int b) { FILE: src/com/interview/array/MoveAllZerosToEnd.java class MoveAllZerosToEnd (line 3) | public class MoveAllZerosToEnd { method moveZeros (line 5) | public void moveZeros(int arr[]){ method main (line 22) | public static void main(String args[]){ FILE: src/com/interview/array/MultiplyAllFieldsExceptOwnPosition.java class MultiplyAllFieldsExceptOwnPosition (line 6) | public class MultiplyAllFieldsExceptOwnPosition { method multiply (line 8) | public int[] multiply(int nums[]) { FILE: src/com/interview/array/NthElementOfCountNumberSequence.java class NthElementOfCountNumberSequence (line 14) | public class NthElementOfCountNumberSequence { method nthElement (line 16) | public List nthElement(int n) { method main (line 43) | public static void main(String args[]) { FILE: src/com/interview/array/NumberOfTrianglesInUnsortedArray.java class NumberOfTrianglesInUnsortedArray (line 8) | public class NumberOfTrianglesInUnsortedArray { method numberOfTriangles (line 10) | public int numberOfTriangles(int input[]){ method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/array/PositiveAndNegativeNumberAlternatively.java class PositiveAndNegativeNumberAlternatively (line 6) | public class PositiveAndNegativeNumberAlternatively { method arrange (line 8) | public void arrange(int arr[]){ method segregate (line 19) | private int segregate(int arr[]){ method swap (line 34) | private void swap(int arr[],int i,int j){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/array/PositiveAndNegativeNumberAlternativelyMaintainingOrder.java class PositiveAndNegativeNumberAlternativelyMaintainingOrder (line 17) | public class PositiveAndNegativeNumberAlternativelyMaintainingOrder { method rearrange (line 19) | public void rearrange(int input[]) { method findNext (line 40) | private int findNext(int input[], int start, boolean isPositive) { method rightRotate (line 49) | private void rightRotate(int input[], int start, int end) { method main (line 57) | public static void main(String args[]) { FILE: src/com/interview/array/RearrangeArrayPerIndex.java class RearrangeArrayPerIndex (line 16) | public class RearrangeArrayPerIndex { method rearrange (line 18) | public void rearrange(int input[]) { method rearrangeUtil (line 35) | private void rearrangeUtil(int input[], int start) { method main (line 46) | public static void main(String args[]) { FILE: src/com/interview/array/RearrangeSuchThatArriBecomesArrArri.java class RearrangeSuchThatArriBecomesArrArri (line 6) | public class RearrangeSuchThatArriBecomesArrArri { method rearrange (line 8) | public void rearrange(int arr[]){ method main (line 24) | public static void main(String args[]){ FILE: src/com/interview/array/ReorderArrayByIndex.java class ReorderArrayByIndex (line 17) | public class ReorderArrayByIndex { method reorder (line 18) | public void reorder(int input[], int index[]) { method main (line 36) | public static void main(String args[]) { FILE: src/com/interview/array/RepeatingAndMissingNumber.java class RepeatingAndMissingNumber (line 6) | public class RepeatingAndMissingNumber { class Pair (line 8) | class Pair{ method toString (line 11) | public String toString(){ method findNumbers (line 16) | public Pair findNumbers(int input[]){ method main (line 36) | public static void main(String args[]){ FILE: src/com/interview/array/RotationWithMaxSum.java class RotationWithMaxSum (line 14) | public class RotationWithMaxSum { method maxSum (line 15) | int maxSum(int input[]) { method main (line 32) | public static void main(String args[]) { FILE: src/com/interview/array/SelfCrossing.java class SelfCrossing (line 6) | public class SelfCrossing { method isSelfCrossing (line 8) | public boolean isSelfCrossing(int[] x) { method main (line 40) | public static void main(String args[]) { FILE: src/com/interview/array/ShortestPalindrome.java class ShortestPalindrome (line 18) | public class ShortestPalindrome { method shortestPalindrome (line 19) | public String shortestPalindrome(String s) { method kmp (line 36) | private int kmp(char[] input) { method createInput (line 63) | private char[] createInput(String s) { method main (line 77) | public static void main(String args[]) { FILE: src/com/interview/array/SmallestIntegerNotRepresentedBySubsetSum.java class SmallestIntegerNotRepresentedBySubsetSum (line 14) | public class SmallestIntegerNotRepresentedBySubsetSum { method findSmallestInteger (line 16) | public int findSmallestInteger(int input[]) { method minPatches (line 31) | public int minPatches(int[] nums, int n) { method main (line 48) | public static void main(String args[]) { FILE: src/com/interview/array/SmallestSubarrayWithAtleastKSum.java class SmallestSubarrayWithAtleastKSum (line 6) | public class SmallestSubarrayWithAtleastKSum { method shortestSubarray (line 8) | public int shortestSubarray(int[] A, int K) { method main (line 47) | public static void main(String[] args) { FILE: src/com/interview/array/SortedArrayTransformation.java class SortedArrayTransformation (line 14) | public class SortedArrayTransformation { method sortTransformedArray (line 15) | public int[] sortTransformedArray(int[] nums, int a, int b, int c) { method apply (line 36) | private int apply(int x, int a, int b, int c) { FILE: src/com/interview/array/StableMarriageProblem.java class StableMarriageProblem (line 3) | public class StableMarriageProblem { method checkIfNewIsBetter (line 5) | private boolean checkIfNewIsBetter(int priority[][], int bride, method findPair (line 18) | public int[] findPair(int[][] priority) { method main (line 59) | public static void main(String args[]){ FILE: src/com/interview/array/SubarrayWithGivenSum.java class SubarrayWithGivenSum (line 6) | public class SubarrayWithGivenSum { class Pair (line 8) | class Pair{ method toString (line 12) | public String toString(){ method findSubArray (line 16) | public Pair findSubArray(int input[],int sum){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/array/SummaryRanges.java class SummaryRanges (line 22) | public class SummaryRanges { method summaryRanges (line 23) | public List summaryRanges(int[] nums) { method makeRange (line 45) | private String makeRange(int a, int b) { FILE: src/com/interview/array/ThreeSumSmallerThanTarget.java class ThreeSumSmallerThanTarget (line 11) | public class ThreeSumSmallerThanTarget { method threeSumSmaller (line 12) | public int threeSumSmaller(int[] nums, int target) { FILE: src/com/interview/array/TrappingWater.java class TrappingWater (line 7) | public class TrappingWater { method trap (line 9) | public int trap(int[] height) { method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/array/TripletInArray.java class TripletInArray (line 10) | public class TripletInArray { class Triplet (line 12) | class Triplet { method toString (line 17) | public String toString() { method findTriplet (line 22) | public Triplet findTriplet(int input[], int sum) { method threeSum (line 50) | public List> threeSum(int[] nums) { method main (line 84) | public static void main(String args[]){ FILE: src/com/interview/array/TripletSumLessThanTotal.java class TripletSumLessThanTotal (line 13) | public class TripletSumLessThanTotal { method findAllTriplets (line 15) | public int findAllTriplets(int input[], int total) { method main (line 34) | public static void main(String args[]) { FILE: src/com/interview/array/TugOfWar.java class TugOfWar (line 9) | public class TugOfWar { method findMind (line 12) | public int findMind(int arr[]){ method combinationUtil (line 22) | private void combinationUtil(int arr[],int k, int start,int sum, int t... method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/array/WaterContainer.java class WaterContainer (line 10) | public class WaterContainer { method maxArea (line 11) | public int maxArea(int[] height) { FILE: src/com/interview/array/WiggleSort.java class WiggleSort (line 17) | public class WiggleSort { method wiggleSort2 (line 20) | public void wiggleSort2(int[] arr) { method wiggleSort1 (line 46) | public void wiggleSort1(int[] nums) { method next (line 62) | private int next(int index, int n) { method swap (line 66) | private void swap(int arr[],int low,int high){ method main (line 72) | public static void main(String args[]) { FILE: src/com/interview/array/ZigZagArrangement.java class ZigZagArrangement (line 16) | public class ZigZagArrangement { method rearrange (line 18) | public void rearrange(int input[]) { method swap (line 34) | private void swap(int input[], int i, int j) { method main (line 40) | public static void main(String args[]) { FILE: src/com/interview/binarysearch/ArithmeticProgressionSearch.java class ArithmeticProgressionSearch (line 6) | public class ArithmeticProgressionSearch { method search (line 8) | public int search(int input[]){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/BinarySearch.java class BinarySearch (line 6) | public class BinarySearch { method search (line 8) | public int search(final int input[], int search) { method main (line 25) | public static void main(String args[]) { FILE: src/com/interview/binarysearch/CircularBinarySearch.java class CircularBinarySearch (line 14) | public class CircularBinarySearch { method search (line 18) | public int search(int arr[]) { method main (line 45) | public static void main(String args[]) { FILE: src/com/interview/binarysearch/CountNDistinctPairsWithDifferenceK.java class CountNDistinctPairsWithDifferenceK (line 8) | public class CountNDistinctPairsWithDifferenceK { method count (line 10) | public int count(int arr[],int k){ method binarySearch (line 22) | private boolean binarySearch(int arr[],int start,int end,int num){ method main (line 37) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/FirstOccurrenceOfNumberInSortedArray.java class FirstOccurrenceOfNumberInSortedArray (line 6) | public class FirstOccurrenceOfNumberInSortedArray { method firstOccurrence (line 8) | public int firstOccurrence(int input[], int x){ method main (line 25) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/FloorAndCeilingSortedArray.java class FloorAndCeilingSortedArray (line 6) | public class FloorAndCeilingSortedArray { method floor (line 8) | public int floor(int input[], int x){ method ceiling (line 24) | public int ceiling(int input[], int x){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/MedianOfTwoSortedArray.java class MedianOfTwoSortedArray (line 6) | public class MedianOfTwoSortedArray { method median (line 8) | public double median(int arr1[],int arr2[]){ method getMedian (line 48) | private double getMedian(int arr[],int low,int high){ method main (line 57) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/MedianOfTwoSortedArrayOfDifferentLength.java class MedianOfTwoSortedArrayOfDifferentLength (line 18) | public class MedianOfTwoSortedArrayOfDifferentLength { method findMedianSortedArrays (line 20) | public double findMedianSortedArrays(int input1[], int input2[]) { method main (line 62) | public static void main(String[] args) { FILE: src/com/interview/binarysearch/MinimumInSortedRotatedArray.java class MinimumInSortedRotatedArray (line 6) | public class MinimumInSortedRotatedArray { method findMin (line 7) | public int findMin(int[] nums) { FILE: src/com/interview/binarysearch/MissingNumberInConsecutiveNumbers.java class MissingNumberInConsecutiveNumbers (line 6) | public class MissingNumberInConsecutiveNumbers { method findMissing (line 8) | public Integer findMissing(int arr[]){ method main (line 28) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/MonotonicallyIncreasingFunctionBecomesPositive.java class MonotonicallyIncreasingFunctionBecomesPositive (line 6) | public class MonotonicallyIncreasingFunctionBecomesPositive { method f (line 8) | private int f(int x){ method findPoint (line 12) | public int findPoint(){ method binarySearch (line 20) | private int binarySearch(int start,int end){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/NumberOfPairWithXPowerYGreaterThanYPowerX.java class NumberOfPairWithXPowerYGreaterThanYPowerX (line 10) | public class NumberOfPairWithXPowerYGreaterThanYPowerX { method countPairs (line 12) | public int countPairs(int X[],int Y[]){ method count (line 32) | private int count(int x, int Y[],Map hardCount){ method upperBound (line 52) | private int upperBound(int x, int arr[]){ method main (line 69) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/PeakElement.java class PeakElement (line 13) | public class PeakElement { method findPeakElement (line 15) | public int findPeakElement(int[] nums) { method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/SearchForRange.java class SearchForRange (line 14) | public class SearchForRange { method searchRange (line 15) | public int[] searchRange(int[] nums, int target) { method firstOccurence (line 24) | private int firstOccurence(int[] nums, int target) { method lastOccurence (line 40) | private int lastOccurence(int[] nums, int target) { method main (line 56) | public static void main(String args[]) { FILE: src/com/interview/binarysearch/SearchInsertPosition.java class SearchInsertPosition (line 6) | public class SearchInsertPosition { method searchInsert (line 7) | public int searchInsert(int[] nums, int target) { FILE: src/com/interview/binarysearch/SortedAndRotatedArraySearch.java class SortedAndRotatedArraySearch (line 16) | public class SortedAndRotatedArraySearch { method search (line 21) | public int search(int arr[],int search){ method searchWithDuplicates (line 50) | public boolean searchWithDuplicates(int[] arr, int search) { method main (line 80) | public static void main(String args[]){ FILE: src/com/interview/binarysearch/SquareRootOfNumber.java class SquareRootOfNumber (line 7) | public class SquareRootOfNumber { method mySqrt (line 8) | public int mySqrt(int x) { FILE: src/com/interview/bits/AddTwoNumberInBinaryRepresentation.java class AddTwoNumberInBinaryRepresentation (line 8) | public class AddTwoNumberInBinaryRepresentation { method add (line 10) | public int add(char[] num1,char[] num2){ method addTwoNumbersWithoutArithmeticOperator (line 42) | public int addTwoNumbersWithoutArithmeticOperator(int num1,int num2){ method addTwoNumbersWithoutArithmeticOperatorFaster (line 59) | public int addTwoNumbersWithoutArithmeticOperatorFaster(int num1,int n... method printResult (line 68) | public void printResult(int num){ method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/bits/BitRotation.java class BitRotation (line 6) | public class BitRotation { method rotateLeft (line 8) | public byte rotateLeft(byte num, int d){ method main (line 12) | public static void main(String args[]){ FILE: src/com/interview/bits/ByteAsStorage.java class ByteAsStorage (line 3) | public class ByteAsStorage { method useByteAsBoolean (line 5) | void useByteAsBoolean(boolean[] visited){ method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/bits/CountBits.java class CountBits (line 6) | public class CountBits { method CountBits (line 8) | public CountBits(){ method countBits (line 11) | public int countBits(int num){ method preCalculate (line 22) | void preCalculate(){ method countBitsFaster (line 28) | public int countBitsFaster(int num){ method countBitsEvenFaster (line 40) | public int countBitsEvenFaster(int x){ method main (line 53) | public static void main(String args[]){ FILE: src/com/interview/bits/CountingBitsTillNum.java class CountingBitsTillNum (line 15) | public class CountingBitsTillNum { method countBits (line 16) | public int[] countBits(int num) { FILE: src/com/interview/bits/DrawHorizontalLine.java class DrawHorizontalLine (line 6) | public class DrawHorizontalLine { method draw (line 8) | public void draw(byte[] screen, int width, int x1, int x2,int y){ method drawFaster (line 23) | public void drawFaster(byte[] screen,int width,int x1,int x2,int y){ method printScreen (line 47) | private void printScreen(byte[] screen,int width){ method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/bits/FindNumberOccurringOnceOtherNumbers3Times.java class FindNumberOccurringOnceOtherNumbers3Times (line 6) | public class FindNumberOccurringOnceOtherNumbers3Times { method getNumberOccurringOnce (line 8) | public int getNumberOccurringOnce(int arr[]){ method main (line 20) | public static void main(String args[]){ FILE: src/com/interview/bits/GrayCode.java class GrayCode (line 14) | public class GrayCode { method grayCode (line 15) | public List grayCode(int n) { method main (line 23) | public static void main(String args[]) { FILE: src/com/interview/bits/InsertMintoNiTojBits.java class InsertMintoNiTojBits (line 6) | public class InsertMintoNiTojBits { method insert (line 8) | public int insert(int M,int N, int i, int j){ method main (line 18) | public static void main(String args[]){ FILE: src/com/interview/bits/MaxProductWordLength.java class MaxProductWordLength (line 18) | public class MaxProductWordLength { method maxProduct (line 19) | public int maxProduct(String[] words) { FILE: src/com/interview/bits/MissingNumbers.java class Pair (line 3) | class Pair{ class MissingNumbers (line 12) | public class MissingNumbers { method findMissingAndRepeated (line 14) | public Pair findMissingAndRepeated(int arr[], int n){ method findTwoMissingNumber (line 47) | public Pair findTwoMissingNumber(int arr[], int n){ method main (line 80) | public static void main(String args[]){ FILE: src/com/interview/bits/NextHigherAndNextLowerWithSameNumberBits.java class NextHigherAndNextLowerWithSameNumberBits (line 6) | public class NextHigherAndNextLowerWithSameNumberBits { method nextHigher (line 8) | public int nextHigher(int n){ method nextLower (line 32) | public int nextLower(int n){ method main (line 57) | public static void main(String args[]){ FILE: src/com/interview/bits/NextPowerOf2.java class NextPowerOf2 (line 6) | public class NextPowerOf2 { method nextPowerOf2 (line 8) | public int nextPowerOf2(int num){ method main (line 20) | public static void main(String args[]){ FILE: src/com/interview/bits/NumberOccuringOddTimes.java class NumberOccuringOddTimes (line 7) | public class NumberOccuringOddTimes { method oneNumberOccuringOddTimes (line 9) | public int oneNumberOccuringOddTimes(int arr[]){ class Pair (line 17) | class Pair{ method twoNumbersOccuringOddTimes (line 23) | public Pair twoNumbersOccuringOddTimes(int arr[]){ method main (line 45) | public static void main(String args[]){ FILE: src/com/interview/bits/NumberOfBitsFlipToConvertNToM.java class NumberOfBitsFlipToConvertNToM (line 6) | public class NumberOfBitsFlipToConvertNToM { method number (line 8) | public int number(int m, int n){ method main (line 17) | public static void main(String args[]){ FILE: src/com/interview/bits/RealNumberToBinary.java class RealNumberToBinary (line 6) | public class RealNumberToBinary { method print (line 8) | public void print(double num){ method main (line 28) | public static void main(String args[]){ FILE: src/com/interview/bits/RepeatedDnaSequence.java class RepeatedDnaSequence (line 16) | public class RepeatedDnaSequence { method findRepeatedDnaSequences (line 21) | public List findRepeatedDnaSequences(String s) { method createString (line 51) | private String createString(int input) { method add (line 59) | private int add(int input, char ch) { method getVal (line 66) | private int getVal(char ch) { method getChar (line 81) | private char getChar(int val) { method main (line 96) | public static void main(String args[]) { FILE: src/com/interview/bits/ReverseBits.java class ReverseBits (line 6) | public class ReverseBits { method reverse (line 8) | public int reverse(int num){ method main (line 21) | public static void main(String args[]){ FILE: src/com/interview/bits/SquareOfNumber.java class SquareOfNumber (line 12) | public class SquareOfNumber { method square (line 14) | public int square(int n){ method fastSquare (line 34) | public int fastSquare(int n){ method fastSquareRec (line 42) | private int fastSquareRec(int n, int leftToMultiply){ method main (line 57) | public static void main(String args[]){ FILE: src/com/interview/bits/SwapOddEvenBits.java class SwapOddEvenBits (line 6) | public class SwapOddEvenBits { method swap (line 8) | public int swap(int num){ method main (line 14) | public static void main(String args[]){ FILE: src/com/interview/bits/SwapTwoBits.java class SwapTwoBits (line 6) | public class SwapTwoBits { method swap (line 8) | public int swap(int num,int i, int j){ method betterSwap (line 18) | public int betterSwap(int num,int i,int j){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/bits/WinnerWithBeautifulNumber.java class WinnerWithBeautifulNumber (line 14) | public class WinnerWithBeautifulNumber { method winner (line 16) | public int winner(int n){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/dynamic/BitonicSequence.java class BitonicSequence (line 6) | public class BitonicSequence { method longestSequence (line 8) | public int longestSequence(int arr[]){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/dynamic/BoxStacking.java class BoxStacking (line 28) | public class BoxStacking { method maxHeight (line 30) | public int maxHeight(Dimension[] input) { method createAllRotation (line 74) | private void createAllRotation(Dimension[] input, method main (line 88) | public static void main(String args[]) { class Dimension (line 102) | class Dimension implements Comparable { method Dimension (line 107) | Dimension(int height, int length, int width) { method Dimension (line 113) | Dimension() { method createDimension (line 116) | static Dimension createDimension(int height, int side1, int side2) { method compareTo (line 132) | @Override method toString (line 141) | @Override FILE: src/com/interview/dynamic/BreakMultipleWordsWithNoSpaceIntoSpace.java class BreakMultipleWordsWithNoSpaceIntoSpace (line 28) | public class BreakMultipleWordsWithNoSpaceIntoSpace { method breakWord (line 35) | public String breakWord(char[] str,int low,Set dictionary){ method breakWordDP (line 60) | public String breakWordDP(String word, Set dict){ method wordBreakTopDown (line 113) | public List wordBreakTopDown(String s, Set wordDict) { method wordBreakUtil (line 122) | private List wordBreakUtil(String s, Set dict, Map wordD... method wordBreakTopDownOneSolutionUtil (line 161) | private boolean wordBreakTopDownOneSolutionUtil(String s, Set ... method wordBreakBottomUp (line 184) | public boolean wordBreakBottomUp(String s, List wordList) { method main (line 202) | public static void main(String args[]){ FILE: src/com/interview/dynamic/BurstBalloons.java class BurstBalloons (line 19) | public class BurstBalloons { method maxCoinsBottomUpDp (line 24) | public int maxCoinsBottomUpDp(int[] nums) { method maxCoinsRec (line 66) | public int maxCoinsRec(int nums[]) { method maxCoinsRecUtil (line 76) | private int maxCoinsRecUtil(int[] nums) { method formNewArray (line 92) | private int[] formNewArray(int[] input, int doNotIncludeIndex) { method main (line 105) | public static void main(String args[]) { FILE: src/com/interview/dynamic/CoinChanging.java class CoinChanging (line 16) | public class CoinChanging { method numberOfSolutions (line 18) | public int numberOfSolutions(int total, int coins[]){ method numberOfSolutionsOnSpace (line 39) | public int numberOfSolutionsOnSpace(int total, int arr[]){ method printCoinChangingSolution (line 57) | public void printCoinChangingSolution(int total,int coins[]){ method printActualSolution (line 62) | private void printActualSolution(List result,int total,int co... method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/dynamic/CoinChangingMinimumCoin.java class CoinChangingMinimumCoin (line 21) | public class CoinChangingMinimumCoin { method minimumCoinTopDown (line 27) | public int minimumCoinTopDown(int total, int coins[], Map... FILE: src/com/interview/dynamic/DiceThrowWays.java class DiceThrowWays (line 9) | public class DiceThrowWays { method numberOfWays (line 11) | public int numberOfWays(int n, int f, int k){ method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/dynamic/DistinctSubsequence.java class DistinctSubsequence (line 14) | public class DistinctSubsequence { method numDistinct (line 15) | public int numDistinct(String s, String t) { method main (line 35) | public static void main(String args[]) { FILE: src/com/interview/dynamic/DungeonGame.java class DungeonGame (line 14) | public class DungeonGame { method calculateMinimumHP (line 15) | public int calculateMinimumHP(int[][] dungeon) { method main (line 43) | public static void main(String args[]) { FILE: src/com/interview/dynamic/EditDistance.java class EditDistance (line 18) | public class EditDistance { method recEditDistance (line 23) | public int recEditDistance(char[] str1, char str2[], int len1,int len2){ method dynamicEditDistance (line 37) | public int dynamicEditDistance(char[] str1, char[] str2){ method printActualEdits (line 65) | public void printActualEdits(int T[][], char[] str1, char[] str2) { method min (line 92) | private int min(int a,int b, int c){ method main (line 97) | public static void main(String args[]){ FILE: src/com/interview/dynamic/EggDropping.java class EggDropping (line 6) | public class EggDropping { method calculate (line 8) | public int calculate(int eggs, int floors){ method calculateRecursive (line 30) | public int calculateRecursive(int eggs, int floors){ method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/dynamic/ExpressionEvaluation.java class ExpressionEvaluation (line 17) | public class ExpressionEvaluation { method evaluate (line 19) | public boolean evaluate(char[] expression, int result) { method operate (line 70) | private int operate(char operator, int x, int y) { class Holder (line 84) | static class Holder { method add (line 86) | void add(Integer ch) { method values (line 89) | Set values() { method main (line 94) | public static void main(String args[]) { FILE: src/com/interview/dynamic/FibonacciSeries.java class FibonacciSeries (line 24) | public class FibonacciSeries { method fibonacciSeries (line 30) | public int fibonacciSeries(int n){ method fibonacciSeriesRecursive (line 51) | public int fibonacciSeriesRecursive(int n){ method main (line 58) | public static void main(String args[]){ FILE: src/com/interview/dynamic/Immutable2DSumRangeQuery.java class Immutable2DSumRangeQuery (line 16) | public class Immutable2DSumRangeQuery { method Immutable2DSumRangeQuery (line 19) | public Immutable2DSumRangeQuery(int[][] matrix) { method sumQuery (line 34) | public int sumQuery(int row1, int col1, int row2, int col2) { method main (line 42) | public static void main(String args[]) { FILE: src/com/interview/dynamic/Knapsack01.java class Knapsack01 (line 24) | public class Knapsack01 { method bottomUpDP (line 29) | public int bottomUpDP(int val[], int wt[], int W){ class Index (line 50) | class Index { method equals (line 54) | @Override method hashCode (line 66) | @Override method topDownRecursive (line 77) | public int topDownRecursive(int values[], int weights[], int W) { method topDownRecursiveUtil (line 83) | public int topDownRecursiveUtil(int values[], int weights[], int remai... method main (line 114) | public static void main(String args[]){ FILE: src/com/interview/dynamic/LongestCommonSubsequence.java class LongestCommonSubsequence (line 6) | public class LongestCommonSubsequence { method lcs (line 8) | public int lcs(char str1[],char str2[],int len1, int len2){ method lcsDynamic (line 21) | public int lcsDynamic(char str1[],char str2[]){ method main (line 43) | public static void main(String args[]){ FILE: src/com/interview/dynamic/LongestCommonSubstring.java class LongestCommonSubstring (line 6) | public class LongestCommonSubstring { method longestCommonSubstring (line 11) | public int longestCommonSubstring(char str1[], char str2[]){ method longestCommonSubstringRec (line 31) | public int longestCommonSubstringRec(char str1[], char str2[], int pos... method main (line 49) | public static void main(String args[]){ FILE: src/com/interview/dynamic/LongestEvenLengthSubstringOfEqualHalf.java class LongestEvenLengthSubstringOfEqualHalf (line 10) | public class LongestEvenLengthSubstringOfEqualHalf { method findMaxLength (line 12) | public int findMaxLength(int input[]){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/dynamic/LongestIncreasingPath.java class LongestIncreasingPath (line 15) | public class LongestIncreasingPath { method longestIncreasingPath (line 17) | public int longestIncreasingPath(int[][] matrix) { method dfs (line 34) | int dfs(int[][] matrix, int i, int j, int[][] distance, int prev) { method main (line 55) | public static void main(String args[]) { FILE: src/com/interview/dynamic/LongestIncreasingSubsequence.java class LongestIncreasingSubsequence (line 23) | public class LongestIncreasingSubsequence { method longestSubsequenceWithActualSolution (line 28) | public int longestSubsequenceWithActualSolution(int arr[]){ method longestSubsequenceRecursive (line 72) | public int longestSubsequenceRecursive(int arr[]){ method longestSubsequenceRecursive (line 83) | private int longestSubsequenceRecursive(int arr[], int pos, int lastNum){ method main (line 95) | public static void main(String args[]){ FILE: src/com/interview/dynamic/LongestPalindromicSubsequence.java class LongestPalindromicSubsequence (line 17) | public class LongestPalindromicSubsequence { method calculate1 (line 19) | public int calculate1(char []str){ method calculateRecursive (line 40) | public int calculateRecursive(char str[],int start,int len){ method main (line 54) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MatrixMultiplicationCost.java class MatrixMultiplicationCost (line 6) | public class MatrixMultiplicationCost { method findCost (line 8) | public int findCost(int arr[]){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MaxSumForNonAdjacentElements.java class MaxSumForNonAdjacentElements (line 17) | public class MaxSumForNonAdjacentElements { method maxSum (line 22) | public int maxSum(int arr[]) { method maxSum (line 36) | public int maxSum(int arr[], int index) { method maxSumCircularArray (line 51) | public int maxSumCircularArray(int[] nums) { method main (line 76) | public static void main(String args[]) { FILE: src/com/interview/dynamic/MaximizeSkiGates.java class MaximizeSkiGates (line 19) | public class MaximizeSkiGates { class Index (line 20) | class Index { method Index (line 26) | Index(int remainingChanges, int current, boolean isRight, int prevIt... method equals (line 33) | @Override method hashCode (line 47) | @Override method solution (line 57) | public int solution(int gates[], int totalDirectionChanges) { method solution (line 62) | public int solution(int gates[], int remainingDirectionChanges, int cu... method main (line 92) | public static void main(String args[]) { FILE: src/com/interview/dynamic/MaximumLengthChainPair.java class MaximumLengthChainPair (line 8) | public class MaximumLengthChainPair { class Pair (line 10) | static class Pair implements Comparable{ method Pair (line 11) | public Pair(int a,int b){ method compareTo (line 17) | @Override method maxLength (line 27) | public int maxLength(Pair[] arr){ method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MaximumProductCutting.java class MaximumProductCutting (line 6) | public class MaximumProductCutting { method maxProduct (line 8) | public int maxProduct(int num){ method main (line 22) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MaximumRectangularSubmatrixOf1s.java class MaximumRectangularSubmatrixOf1s (line 28) | public class MaximumRectangularSubmatrixOf1s { method maximum (line 30) | public int maximum(int input[][]){ method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MaximumSizeSubMatrix.java class MaximumSizeSubMatrix (line 6) | public class MaximumSizeSubMatrix { method min (line 8) | private int min(int a,int b, int c){ method maxSize (line 13) | public int maxSize(int arr[][]){ method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MaximumSumSubsequence.java class MaximumSumSubsequence (line 15) | public class MaximumSumSubsequence { method maxSum (line 17) | public int maxSum(int arr[]){ method main (line 41) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MinCostPath.java class MinCostPath (line 6) | public class MinCostPath { method minCost (line 8) | public int minCost(int [][]cost,int m,int n){ method minCostRec (line 30) | public int minCostRec(int cost[][], int m, int n){ method minCostRec (line 34) | public int minCostRec(int cost[][], int m, int n, int x, int y){ method min (line 49) | private int min(int a,int b, int c){ method main (line 54) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MinJumpToReachEnd.java class MinJumpToReachEnd (line 23) | public class MinJumpToReachEnd { method minJump (line 25) | public int minJump(int arr[],int result[]){ method jump (line 50) | public int jump(int[] nums) { method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MinimumCostTrainTicket.java class MinimumCostTrainTicket (line 6) | public class MinimumCostTrainTicket { method minCost (line 8) | public int minCost(int ticket[][]){ method main (line 37) | public static void main(String args[]){ FILE: src/com/interview/dynamic/MinimumNumberOfPerfectSquares.java class MinimumNumberOfPerfectSquares (line 18) | public class MinimumNumberOfPerfectSquares { method numSquaresUsingDP (line 19) | public int numSquaresUsingDP(int n) { method numSquaresUsingBFS (line 38) | public int numSquaresUsingBFS(int n) { FILE: src/com/interview/dynamic/MinimumTriangleSum.java class MinimumTriangleSum (line 10) | public class MinimumTriangleSum { method minimumTotal (line 11) | public int minimumTotal(List> triangle) { FILE: src/com/interview/dynamic/NPotGold.java class NPotGold (line 8) | public class NPotGold { class Pair (line 10) | static class Pair{ method toString (line 13) | public String toString(){ method findMoves (line 17) | public Pair[][] findMoves(int pots[]){ method printSequence (line 51) | public void printSequence(int pots[], Pair moves[][]){ method main (line 66) | public static void main(String args[]){ FILE: src/com/interview/dynamic/NumberOfPathsInMxNMatrix.java class NumberOfPathsInMxNMatrix (line 6) | public class NumberOfPathsInMxNMatrix { method countPathsRecursive (line 8) | public int countPathsRecursive(int n, int m){ method countPaths (line 15) | public int countPaths(int n,int m){ method main (line 32) | public static void main(String args[]){ FILE: src/com/interview/dynamic/NumberOfWaysToScorePoints.java class NumberOfWaysToScorePoints (line 9) | public class NumberOfWaysToScorePoints { method version1 (line 13) | public int version1(int score[],int total){ method version2 (line 28) | public int version2(int score[],int total){ method main (line 41) | public static void main(String args[]){ FILE: src/com/interview/dynamic/OptimalTreeSearch.java class OptimalTreeSearch (line 6) | public class OptimalTreeSearch { method minCostRec (line 8) | public int minCostRec(int input[],int freq[]){ method minCostRec (line 13) | private int minCostRec(int input[],int freq[],int low,int high,int lev... method minCost (line 30) | public int minCost(int input[], int freq[]){ method getSum (line 55) | private int getSum(int freq[], int i, int j){ method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/dynamic/PaintHouse.java class PaintHouse (line 8) | public class PaintHouse { method minCostTopDownPainHouse1or2 (line 10) | public int minCostTopDownPainHouse1or2(int[][] costs) { method minCostUtil (line 18) | private int minCostUtil(int[][] costs, int house, int prevColor, int k... method minCostBottomUpPaintHouse2 (line 39) | public int minCostBottomUpPaintHouse2(int[][] costs) { class Pair (line 66) | class Pair { method findMinSecondMin (line 71) | private Pair findMinSecondMin(int[] input) { method main (line 95) | public static void main(String args[]) { FILE: src/com/interview/dynamic/PalindromePartition.java class PalindromePartition (line 14) | public class PalindromePartition { method minCut (line 21) | public int minCut(String str){ method partition (line 45) | public List> partition(String s) { method partitionUtil (line 55) | private List> partitionUtil(String s, Map t, Map t1) { method findNeighborsAndPopulateMap (line 66) | private void findNeighborsAndPopulateMap(int x, int y, int input[][], method updateMap (line 75) | private void updateMap(int input[][], int x, int y, int i, int j, method main (line 89) | public static void main(String args[]) { FILE: src/com/interview/dynamic/RegexMatching.java class RegexMatching (line 10) | public class RegexMatching { method matchRegexRecursive (line 12) | public boolean matchRegexRecursive(char[] str, char[] pattern){ method matchRegexRecursive (line 16) | private boolean matchRegexRecursive(char text[], char pattern[], int p... method matchRegex (line 50) | public boolean matchRegex(char[] text, char[] pattern) { method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/dynamic/RemoveFromEndToMake2IntoMinGreaterThanMax.java class RemoveFromEndToMake2IntoMinGreaterThanMax (line 6) | public class RemoveFromEndToMake2IntoMinGreaterThanMax { method removeFromEnd (line 8) | public int removeFromEnd(int input[]){ method removeFromEnd (line 12) | private int removeFromEnd(int input[],int low,int high){ method min (line 25) | private int min(int input[],int low,int high){ method max (line 34) | private int max(int input[],int low,int high){ method removeFromEndDynamic (line 44) | public int removeFromEndDynamic(int input[]){ method main (line 59) | public static void main(String args[]){ FILE: src/com/interview/dynamic/ScrambledString.java class ScrambledString (line 9) | public class ScrambledString { class Index (line 14) | private static class Index { method equals (line 19) | @Override method hashCode (line 33) | @Override method isScrambled (line 45) | boolean isScrambled(char input1[], char input2[], int start1, int end1... method main (line 129) | public static void main(String args[]) { FILE: src/com/interview/dynamic/StockBuySellKTransactions.java class StockBuySellKTransactions (line 18) | public class StockBuySellKTransactions { method maxProfitLinearSpace (line 23) | public int maxProfitLinearSpace(int k, int[] prices) { method allTimeProfit (line 46) | public int allTimeProfit(int arr[]){ method maxProfit (line 69) | public int maxProfit(int prices[], int K) { method maxProfitSlowSolution (line 91) | public int maxProfitSlowSolution(int prices[], int K) { method printActualSolution (line 110) | public void printActualSolution(int T[][], int prices[]) { method main (line 142) | public static void main(String args[]) { FILE: src/com/interview/dynamic/SubRectangularMatrixWithMaximumSum.java class SubRectangularMatrixWithMaximumSum (line 22) | public class SubRectangularMatrixWithMaximumSum { class Result (line 24) | class Result{ method toString (line 30) | @Override method maxSum (line 39) | public Result maxSum(int input[][]){ class KadaneResult (line 65) | class KadaneResult{ method KadaneResult (line 69) | public KadaneResult(int maxSum, int start, int end) { method kadane (line 76) | private KadaneResult kadane(int arr[]){ method main (line 98) | public static void main(String args[]){ FILE: src/com/interview/dynamic/SubsetSum.java class SubsetSum (line 15) | public class SubsetSum { method subsetSum (line 17) | public boolean subsetSum(int input[], int total) { method partition (line 37) | public boolean partition(int arr[]) { method main (line 65) | public static void main(String args[]) { FILE: src/com/interview/dynamic/SubsquareSurrounedByXs.java class SubsquareSurrounedByXs (line 30) | public class SubsquareSurrounedByXs { class Cell (line 32) | class Cell{ method findSubSquare (line 36) | public int findSubSquare(char input[][]){ method main (line 96) | public static void main(String args[]){ FILE: src/com/interview/dynamic/SymbolExpressionEvaluation.java class SymbolExpressionEvaluation (line 18) | public class SymbolExpressionEvaluation { method evaluateExpression (line 20) | public boolean evaluateExpression(char input[][], Map values() { FILE: src/com/interview/dynamic/TextJustification.java class TextJustification (line 34) | public class TextJustification { method justify (line 36) | public String justify(String words[], int width) { method main (line 98) | public static void main(String args[]){ FILE: src/com/interview/dynamic/TwoStringInterleavingToFormThird.java class TwoStringInterleavingToFormThird (line 7) | public class TwoStringInterleavingToFormThird { method isInterleavedRecursive (line 9) | public boolean isInterleavedRecursive(char str1[], char str2[], char s... method isInterleaved (line 23) | public boolean isInterleaved(char str1[], char str2[], char str3[]){ method main (line 54) | public static void main(String args[]){ FILE: src/com/interview/dynamic/UglyNumbers.java class UglyNumbers (line 15) | public class UglyNumbers { class Node (line 17) | static class Node implements Comparable { method Node (line 21) | Node (int inputIndex, int index, int val) { method compareTo (line 27) | @Override method nthSuperUglyNumber1 (line 33) | public int nthSuperUglyNumber1(int n, int[] primes) { method ugly (line 54) | int ugly(int n){ method min (line 78) | private int min(int a,int b, int c){ method main (line 83) | public static void main(String args[]) { FILE: src/com/interview/dynamic/WeightedJobSchedulingMaximumProfit.java class Job (line 6) | class Job{ method Job (line 10) | Job(int start,int end,int profit){ class FinishTimeComparator (line 17) | class FinishTimeComparator implements Comparator{ method compare (line 19) | @Override class WeightedJobSchedulingMaximumProfit (line 35) | public class WeightedJobSchedulingMaximumProfit { method maximum (line 45) | public int maximum(Job[] jobs){ method main (line 69) | public static void main(String args[]){ FILE: src/com/interview/dynamic/WildCardMatching.java class WildCardMatching (line 12) | public class WildCardMatching { method isMatch (line 13) | public boolean isMatch(String s, String p) { method isMatchRecursive (line 58) | public boolean isMatchRecursive(String s, String p) { method isMatchRecursiveUtil (line 62) | private boolean isMatchRecursiveUtil(char[] text, char[] pattern, int ... method main (line 89) | public static void main(String args[]) { FILE: src/com/interview/geometry/ClosestPairOfPoints.java class Point (line 29) | class Point{ method Point (line 32) | Point(int x, int y){ class XCoordinatorSorter (line 38) | class XCoordinatorSorter implements Comparator{ method compare (line 39) | @Override class YCoordinatorSorter (line 49) | class YCoordinatorSorter implements Comparator{ method compare (line 50) | @Override class ClosestPairOfPoints (line 60) | public class ClosestPairOfPoints { method closestPairOfPoints (line 63) | public double closestPairOfPoints(Point[] points){ method closestPairOfPoints (line 85) | private int closestPairOfPoints(Point[] px, Point[] py,int start, int ... method closest (line 115) | private int closest(List deltaPoints){ method distance (line 128) | private int distance(Point p1, Point p2){ method computeMinDistance (line 132) | private int computeMinDistance(Point[] points, int start, int end){ method main (line 149) | public static void main(String args[]){ FILE: src/com/interview/geometry/GrahamScanConvexHull.java class GrahamScanConvexHull (line 26) | public class GrahamScanConvexHull { class Point (line 28) | static class Point{ method Point (line 31) | Point(int x, int y){ method findConvexHull (line 37) | public List findConvexHull(Point[] points) { method sortToHandleCollinear (line 71) | private void sortToHandleCollinear(Point[] points, Point start) { method distance (line 106) | private int distance(Point a, Point b, Point c) { method crossProduct (line 120) | private int crossProduct(Point a, Point b, Point c) { method main (line 128) | public static void main(String[] args) { FILE: src/com/interview/geometry/JarvisMarchConvexHull.java class JarvisMarchConvexHull (line 29) | public class JarvisMarchConvexHull { class Point (line 31) | class Point{ method Point (line 34) | Point(int x, int y){ method findConvexHull (line 40) | public List findConvexHull(Point[] points) { method distance (line 97) | private int distance(Point a, Point b, Point c) { method crossProduct (line 111) | private int crossProduct(Point a, Point b, Point c) { FILE: src/com/interview/geometry/MaximumPointsOnSameLine.java class MaximumPointsOnSameLine (line 17) | public class MaximumPointsOnSameLine { class Point (line 19) | static class Point { method Point (line 22) | Point() { x = 0; y = 0; } method Point (line 23) | Point(int a, int b) { x = a; y = b; } class Pair (line 26) | class Pair { method equals (line 30) | @Override method hashCode (line 42) | @Override method maxPoints (line 50) | public int maxPoints(Point[] points) { method gcd (line 85) | int gcd(int a, int b) { FILE: src/com/interview/geometry/SkylineDrawing.java class SkylineDrawing (line 18) | public class SkylineDrawing { class BuildingPoint (line 23) | static class BuildingPoint implements Comparable { method compareTo (line 28) | @Override method getSkyline (line 43) | public List getSkyline(int[][] buildings) { method main (line 103) | public static void main(String args[]) { FILE: src/com/interview/graph/AlientDictionary.java class AlientDictionary (line 12) | public class AlientDictionary { method alienOrder (line 13) | public String alienOrder(String[] words) { method topSortUtil (line 33) | private boolean topSortUtil(char vertex, Deque stack, Set> buildGraph(String words[], Map<... method getAllChars (line 84) | private void getAllChars(String words[], Map degre... method alienOrder1 (line 93) | public String alienOrder1(String words[]) { method main (line 127) | public static void main(String args[]) { FILE: src/com/interview/graph/AllCyclesInDirectedGraphJohnson.java class AllCyclesInDirectedGraphJohnson (line 19) | public class AllCyclesInDirectedGraphJohnson { method simpleCyles (line 28) | public List>> simpleCyles(Graph graph) { method leastIndexSCC (line 56) | private Optional> leastIndexSCC(List u) { method findCyclesInSCG (line 97) | private boolean findCyclesInSCG( method getBSet (line 141) | private Set> getBSet(Vertex v) { method createSubGraph (line 146) | private Graph createSubGraph(long startVertex, Graph graph) { method main (line 156) | public static void main(String args[]) { FILE: src/com/interview/graph/AllCyclesInDirectedGraphTarjan.java class AllCyclesInDirectedGraphTarjan (line 14) | public class AllCyclesInDirectedGraphTarjan { method AllCyclesInDirectedGraphTarjan (line 21) | public AllCyclesInDirectedGraphTarjan() { method reset (line 25) | private void reset() { method findAllSimpleCycles (line 32) | public List>> findAllSimpleCycles(Graph ... method findAllSimpleCycles (line 45) | private boolean findAllSimpleCycles(Vertex start, Vertex curr... method main (line 80) | public static void main(String args[]) { FILE: src/com/interview/graph/ArticulationPoint.java class ArticulationPoint (line 34) | public class ArticulationPoint { method findarticulationPoints (line 38) | public Set> findarticulationPoints(Graph graph) { method DFS (line 52) | private void DFS(Set> visited, method main (line 97) | public static void main(String args[]){ FILE: src/com/interview/graph/BellmanFordShortestPath.java class BellmanFordShortestPath (line 22) | public class BellmanFordShortestPath { class NegativeWeightCycleException (line 28) | class NegativeWeightCycleException extends RuntimeException { method getShortestPath (line 31) | public Map, Integer> getShortestPath(Graph gr... method main (line 76) | public static void main(String args[]){ FILE: src/com/interview/graph/BinaryMaxHeap.java class BinaryMaxHeap (line 6) | public class BinaryMaxHeap { class Node (line 10) | class Node { method add (line 15) | public void add(int weight,T data) { method swap (line 39) | private void swap(Node node1,Node node2){ method max (line 50) | public T max(){ method empty (line 54) | public boolean empty(){ method extractMap (line 59) | public T extractMap(){ method printHeap (line 89) | public void printHeap(){ method main (line 95) | public static void main(String args[]){ FILE: src/com/interview/graph/BinaryMinHeap.java class BinaryMinHeap (line 22) | public class BinaryMinHeap { class Node (line 27) | public class Node { method containsData (line 35) | public boolean containsData(T key){ method add (line 42) | public void add(int weight,T key) { method min (line 69) | public T min(){ method empty (line 76) | public boolean empty(){ method decrease (line 83) | public void decrease(T data, int newWeight){ method getWeight (line 102) | public Integer getWeight(T key) { method extractMinNode (line 114) | public Node extractMinNode() { method extractMin (line 153) | public T extractMin(){ method printPositionMap (line 158) | private void printPositionMap(){ method swap (line 162) | private void swap(Node node1,Node node2){ method updatePositionMap (line 173) | private void updatePositionMap(T data1, T data2, int pos1, int pos2){ method printHeap (line 180) | public void printHeap(){ method main (line 186) | public static void main(String args[]){ FILE: src/com/interview/graph/BiparteGraph.java class BiparteGraph (line 12) | public class BiparteGraph { method isBiparte (line 14) | public boolean isBiparte(Graph graph){ method isBiparteDFS (line 54) | public boolean isBiparteDFS(Graph graph){ method isBiparteDFS (line 69) | private boolean isBiparteDFS(Vertex vertex, Set findWords(char[][] board, String[] words) { method findWordsUtil (line 36) | private void findWordsUtil(char[][] board, Trie t , int i, int j, Stri... class TrieNode (line 68) | class TrieNode { method TrieNode (line 71) | public TrieNode() { class Trie (line 75) | class Trie { method Trie (line 78) | public Trie() { method insert (line 83) | public void insert(String word) { method search (line 97) | public boolean search(String word) { method startsWith (line 111) | public boolean startsWith(String prefix) { method printTrie (line 123) | public void printTrie() { method printTrieUtil (line 127) | private void printTrieUtil(TrieNode root) { method main (line 140) | public static void main(String args[]) { FILE: src/com/interview/graph/Bridge.java class Bridge (line 11) | public class Bridge { method getBridge (line 15) | public Set> getBridge(Graph graph){ method BridgeUtil (line 31) | private void BridgeUtil(Vertex vertex, Set> result,Map { method clone (line 18) | public Graph clone(Graph graph){ method clone (line 39) | private void clone(Vertex origVertex,Map,Vertex> clone... method updateMap (line 58) | private void updateMap(Map,Vertex> cloneMap, Vertex cl... method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/graph/CloneGraph.java class CloneGraph (line 9) | public class CloneGraph { class UndirectedGraphNode (line 11) | class UndirectedGraphNode { method UndirectedGraphNode (line 14) | UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList dict) { method replace (line 50) | public String replace(String newWord, int pos, char ch) { method main (line 59) | public static void main(String args[]){ FILE: src/com/interview/graph/CourseSchedule.java class CourseSchedule (line 22) | public class CourseSchedule { method findOrder (line 23) | public int[] findOrder(int numCourses, int[][] prerequisites) { class Neighbors (line 52) | class Neighbors { method topSort (line 56) | private boolean topSort(int course, Neighbors[] graph, boolean[] used,... FILE: src/com/interview/graph/CycleInDirectedGraph.java class CycleInDirectedGraph (line 9) | public class CycleInDirectedGraph { method hasCycle (line 11) | public boolean hasCycle(Graph graph) { method dfs (line 29) | private boolean dfs(Vertex current, Set> whit... method moveVertex (line 51) | private void moveVertex(Vertex vertex, Set> s... method main (line 57) | public static void main(String args[]){ FILE: src/com/interview/graph/CycleUndirectedGraph.java class CycleUndirectedGraph (line 19) | public class CycleUndirectedGraph { method hasCycleUsingDisjointSets (line 21) | public boolean hasCycleUsingDisjointSets(Graph graph){ method hasCycleDFS (line 39) | public boolean hasCycleDFS(Graph graph){ method hasCycleDFSUtil (line 53) | public boolean hasCycleDFSUtil(Vertex vertex, Set> visite... method main (line 70) | public static void main(String args[]){ FILE: src/com/interview/graph/DAGShortestPathTopological.java class DAGShortestPathTopological (line 10) | public class DAGShortestPathTopological { method shortestPath (line 12) | public Map,Integer> shortestPath(Graph graph,Vertex st... method getDistance (line 30) | private int getDistance( Vertex vertex,Map,Integer> dista... method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/graph/DijkstraShortestPath.java class DijkstraShortestPath (line 18) | public class DijkstraShortestPath { method shortestPath (line 20) | public Map,Integer> shortestPath(Graph graph,... method getVertexForEdge (line 79) | private Vertex getVertexForEdge(Vertex v, Edge graph) { method DFSUtil (line 45) | private void DFSUtil(Vertex vertex, method DFSUtil1 (line 57) | private void DFSUtil1(Vertex vertex, method main (line 68) | public static void main(String args[]){ FILE: src/com/interview/graph/DisjointSet.java class DisjointSet (line 22) | public class DisjointSet { class Node (line 26) | class Node { method makeSet (line 35) | public void makeSet(long data) { method union (line 49) | public boolean union(long data1, long data2) { method findSet (line 75) | public long findSet(long data) { method findSet (line 83) | private Node findSet(Node node) { method main (line 92) | public static void main(String args[]) { FILE: src/com/interview/graph/EulerianPathAndCircuit.java class EulerianPathAndCircuit (line 6) | public class EulerianPathAndCircuit { type Eulerian (line 8) | public enum Eulerian{ method isConnected (line 14) | private boolean isConnected(Graph graph){ method DFS (line 41) | private void DFS(Vertex startVertex, Map, Boolean> visited){ method isEulerian (line 50) | public Eulerian isEulerian(Graph graph){ method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/graph/EvaluateDivison.java class EvaluateDivison (line 23) | public class EvaluateDivison { method calcEquation (line 24) | public double[] calcEquation(String[][] equations, double[] values, St... FILE: src/com/interview/graph/FillOsWIthXsIfSurroundedByXs.java class FillOsWIthXsIfSurroundedByXs (line 13) | public class FillOsWIthXsIfSurroundedByXs { method solve (line 15) | public void solve(char[][] board) { method dfs (line 41) | private void dfs(char[][] board, int i, int j) { method main (line 65) | public static void main(String args[]){ FILE: src/com/interview/graph/FloodFillAlgorithm.java class FloodFillAlgorithm (line 7) | public class FloodFillAlgorithm { method fillDFS (line 9) | public void fillDFS(int screen[][], int oldColor, int newColor,int sta... method fillUtil (line 13) | public void fillUtil(int screen[][], int currentx,int currenty, int ol... method main (line 28) | public static void main(String args[]){ FILE: src/com/interview/graph/FloydWarshallAllPairShortestPath.java class FloydWarshallAllPairShortestPath (line 20) | public class FloydWarshallAllPairShortestPath { class NegativeWeightCycleException (line 22) | class NegativeWeightCycleException extends RuntimeException { method allPairShortestPath (line 28) | public int[][] allPairShortestPath(int[][] distanceMatrix) { method printPath (line 71) | public void printPath(int[][] path, int start, int end) { method main (line 97) | public static void main(String args[]){ FILE: src/com/interview/graph/FordFulkerson.java class FordFulkerson (line 22) | public class FordFulkerson { method maxFlow (line 24) | public int maxFlow(int capacity[][], int source, int sink){ method printAugmentedPaths (line 82) | private void printAugmentedPaths(List> augmentedPaths) { method BFS (line 93) | private boolean BFS(int[][] residualCapacity, Map par... method main (line 125) | public static void main(String args[]){ FILE: src/com/interview/graph/Graph.java class Graph (line 9) | public class Graph{ method Graph (line 15) | public Graph(boolean isDirected){ method addEdge (line 21) | public void addEdge(long id1, long id2){ method addVertex (line 27) | public void addVertex(Vertex vertex){ method addSingleVertex (line 37) | public Vertex addSingleVertex(long id){ method getVertex (line 46) | public Vertex getVertex(long id){ method addEdge (line 50) | public void addEdge(long id1,long id2, int weight){ method getAllEdges (line 75) | public List> getAllEdges(){ method getAllVertex (line 79) | public Collection> getAllVertex(){ method setDataForVertex (line 82) | public void setDataForVertex(long id, T data){ method toString (line 89) | @Override class Vertex (line 101) | class Vertex { method Vertex (line 107) | Vertex(long id){ method getId (line 111) | public long getId(){ method setData (line 115) | public void setData(T data){ method getData (line 119) | public T getData(){ method addAdjacentVertex (line 123) | public void addAdjacentVertex(Edge e, Vertex v){ method toString (line 128) | public String toString(){ method getAdjacentVertexes (line 132) | public List> getAdjacentVertexes(){ method getEdges (line 136) | public List> getEdges(){ method getDegree (line 140) | public int getDegree(){ method hashCode (line 144) | @Override method equals (line 152) | @Override class Edge (line 167) | class Edge{ method Edge (line 173) | Edge(Vertex vertex1, Vertex vertex2){ method Edge (line 178) | Edge(Vertex vertex1, Vertex vertex2,boolean isDirected,int weight){ method Edge (line 185) | Edge(Vertex vertex1, Vertex vertex2,boolean isDirected){ method getVertex1 (line 191) | Vertex getVertex1(){ method getVertex2 (line 195) | Vertex getVertex2(){ method getWeight (line 199) | int getWeight(){ method isDirected (line 203) | public boolean isDirected(){ method hashCode (line 207) | @Override method equals (line 216) | @Override method toString (line 238) | @Override FILE: src/com/interview/graph/GraphColoring.java class GraphColoring (line 16) | public class GraphColoring { method WelshPowell (line 18) | public void WelshPowell(){ method colorGraph (line 73) | public void colorGraph(){ method getUnusedColor (line 114) | private String getUnusedColor(Map colorsUsed){ method resetColor (line 123) | private void resetColor(Map colorsUsed){ method assignColor (line 134) | private void assignColor(String color, Map colorsUsed){ method allAdjacentUnColored (line 139) | private boolean allAdjacentUnColored(Collection> verte... method main (line 147) | public static void main(String args[]){ class ComparatorVertex (line 154) | class ComparatorVertex implements Comparator>{ method compare (line 156) | @Override FILE: src/com/interview/graph/GraphTraversal.java class GraphTraversal (line 12) | public class GraphTraversal { method DFS (line 14) | public void DFS(Graph graph){ method DFSUtil (line 24) | private void DFSUtil(Vertex v,Set visited){ method BFS (line 33) | public void BFS(Graph graph){ method main (line 57) | public static void main(String args[]){ FILE: src/com/interview/graph/HamiltonianCycle.java class HamiltonianCycle (line 8) | public class HamiltonianCycle { method getHamiltonianCycle (line 10) | public boolean getHamiltonianCycle(Graph graph,List> resu... method hamiltonianUtil (line 18) | private boolean hamiltonianUtil(Vertex startVertex, Vertex curre... method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/graph/KruskalMST.java class KruskalMST (line 22) | public class KruskalMST { class EdgeComparator (line 26) | public class EdgeComparator implements Comparator> { method compare (line 27) | @Override method getMST (line 37) | public List> getMST(Graph graph) { method main (line 71) | public static void main(String args[]) { FILE: src/com/interview/graph/MaximumBiparteMatching.java class MaximumBiparteMatching (line 13) | public class MaximumBiparteMatching { method findMaxMatching (line 15) | public int findMaxMatching(Map> jobApplications,... method matchJobs (line 26) | private boolean matchJobs(Integer candidate, Map... method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/graph/MinimumHeightTree.java class MinimumHeightTree (line 16) | public class MinimumHeightTree { method findMinHeightTrees (line 17) | public List findMinHeightTrees(int n, int[][] edges) { method main (line 53) | public static void main(String args[]) { FILE: src/com/interview/graph/NumberOfIsland.java class NumberOfIsland (line 6) | public class NumberOfIsland { method numberOfIsland (line 8) | public int numberOfIsland(int[][] graph){ method DFS (line 23) | private void DFS(int[][] graph, boolean[][] visited,int i,int j){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/graph/NumberOfIslandDynamic.java class NumberOfIslandDynamic (line 13) | public class NumberOfIslandDynamic { method numIslands2 (line 14) | public List numIslands2(int n, int m, int[][] positions) { method main (line 58) | public static void main(String args[]) { FILE: src/com/interview/graph/NumberofTriangles.java class NumberofTriangles (line 13) | public class NumberofTriangles { method countTriangles (line 15) | public int countTriangles(Graph graph){ method DFS (line 24) | public int DFS(Vertex vertex, Map,Boolean> vi... method isNeighbor (line 44) | private boolean isNeighbor(Vertex vertex, Vertex des... method main (line 53) | public static void main(String args[]){ FILE: src/com/interview/graph/PrimMST.java class PrimMST (line 18) | public class PrimMST { method primMST (line 23) | public List> primMST(Graph graph){ method getVertexForEdge (line 72) | private Vertex getVertexForEdge(Vertex v, Edge graph,Vertex start, Vert... method printPath (line 19) | private void printPath(Set> visited,Vertex de... method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/graph/ShortestDistanceFromExit.java type Cell (line 6) | enum Cell{ class Point (line 12) | class Point{ method Point (line 15) | Point(int x, int y){ class ShortestDistanceFromExit (line 36) | public class ShortestDistanceFromExit { method findShortest (line 38) | public int[][] findShortest(Cell input[][]){ method setDistance (line 59) | private void setDistance(Cell input[][], int x, int y, int distance[][]){ method setDistanceUtil (line 74) | private void setDistanceUtil(Queue q, Cell input[][], Point p, ... method getNeighbor (line 84) | private Point getNeighbor(Cell input[][], int x, int y){ method main (line 90) | public static void main(String args[]){ FILE: src/com/interview/graph/StronglyConnectedComponent.java class StronglyConnectedComponent (line 30) | public class StronglyConnectedComponent { method scc (line 32) | public List>> scc(Graph graph) { method reverseGraph (line 65) | private Graph reverseGraph(Graph graph) { method DFSUtil (line 74) | private void DFSUtil(Vertex vertex, method DFSUtilForReverseGraph (line 86) | private void DFSUtilForReverseGraph(Vertex vertex, method main (line 98) | public static void main(String args[]){ FILE: src/com/interview/graph/TarjanStronglyConnectedComponent.java class TarjanStronglyConnectedComponent (line 16) | public class TarjanStronglyConnectedComponent { method scc (line 26) | public List>> scc(Graph graph) { method sccUtil (line 59) | private void sccUtil(Vertex vertex) { method main (line 100) | public static void main(String args[]) { FILE: src/com/interview/graph/TopologicalSort.java class TopologicalSort (line 19) | public class TopologicalSort { method topSort (line 24) | public Deque> topSort(Graph graph) { method topSortUtil (line 36) | private void topSortUtil(Vertex vertex, Deque> stack, method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/graph/TransitiveClosure.java class TransitiveClosure (line 6) | public class TransitiveClosure { method getTransitiveClosure (line 8) | public boolean[][] getTransitiveClosure(int [][]graph){ method main (line 30) | public static void main(String args[]){ FILE: src/com/interview/graph/TravelingSalesmanHeldKarp.java class TravelingSalesmanHeldKarp (line 16) | public class TravelingSalesmanHeldKarp { class Index (line 20) | private static class Index { method equals (line 24) | @Override method hashCode (line 35) | @Override method createIndex (line 42) | private static Index createIndex(int vertex, Set vertexSet) { class SetSizeComparator (line 50) | private static class SetSizeComparator implements Comparator parent, int totalVertices) { method getCost (line 133) | private int getCost(Set set, int prevVertex, Map> generateCombination(int n) { method generateCombination (line 153) | private void generateCombination(int input[], int start, int pos, List... method createSet (line 165) | private static Set createSet(int input[], int pos) { FILE: src/com/interview/graph/ValidTree.java class ValidTree (line 13) | public class ValidTree { method validTree (line 14) | public boolean validTree(int n, int[][] edges) { method isCycle (line 49) | boolean isCycle(int vertex, Map> graph, int par... FILE: src/com/interview/graph/WallsAndGates.java class WallsAndGates (line 20) | public class WallsAndGates { method wallsAndGates (line 24) | public void wallsAndGates(int[][] rooms) { method addNeighbors (line 35) | private void addNeighbors(int[][] rooms, int row, int col, Deque queue) { class Cell (line 57) | class Cell { method Cell (line 61) | Cell(int row, int col) { FILE: src/com/interview/graph/WordLadder.java class WordLadder (line 18) | public class WordLadder { method findLadders (line 19) | public List> findLadders(String beginWord, String endWord... method setParent (line 78) | private void setParent(Map> parent, String startW... method main (line 92) | public static void main(String args[]) { FILE: src/com/interview/linklist/AddNumberRepresentedByLinkList.java class AddNumberRepresentedByLinkList (line 11) | public class AddNumberRepresentedByLinkList { method addWithCarry (line 15) | private Node addWithCarry(Node head1, Node head2){ method addRemaining (line 27) | private Node addRemaining(Node start, Node stop){ method add (line 39) | public Node add(Node head1, Node head2){ method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/linklist/CopyLinkListWIthArbitPointer.java class CopyLinkListWIthArbitPointer (line 15) | public class CopyLinkListWIthArbitPointer { class RandomListNode (line 17) | static class RandomListNode { method RandomListNode (line 20) | RandomListNode(int x) { this.label = x; } method copyRandomList (line 23) | public RandomListNode copyRandomList(RandomListNode head) { method main (line 59) | public static void main(String args[]){ FILE: src/com/interview/linklist/DeleteDuplicateNodes.java class DeleteDuplicateNodes (line 16) | public class DeleteDuplicateNodes { method deleteDuplicates (line 17) | public Node deleteDuplicates(Node head) { FILE: src/com/interview/linklist/DeleteNAfterMNodes.java class DeleteNAfterMNodes (line 13) | public class DeleteNAfterMNodes { method deleteNAfterMNodes (line 15) | public void deleteNAfterMNodes(Node head,int m, int n){ method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/linklist/DeleteNodeWithGreaterValueOnRight.java class DeleteNodeWithGreaterValueOnRight (line 10) | public class DeleteNodeWithGreaterValueOnRight { method deleteNodes (line 14) | public Node deleteNodes(Node head){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/linklist/DoubleLinkList.java class DoubleLinkList (line 3) | public class DoubleLinkList { method addNode (line 5) | public Node addNode(Node head,int data){ method addAtFront (line 20) | public Node addAtFront(Node head, int data){ method print (line 30) | public void print(Node head){ method printFrontBack (line 38) | public void printFrontBack(Node head){ method find (line 52) | public Node find(Node head, int data){ method main (line 62) | public static void main(String args[]){ FILE: src/com/interview/linklist/Flatten2DList.java class Flatten2DList (line 15) | public class Flatten2DList implements Iterator { method Flatten2DList (line 19) | public Flatten2DList(List> vec2d) { method next (line 23) | @Override method hasNext (line 37) | @Override FILE: src/com/interview/linklist/FlattenLinkList.java class FlattenLinkList (line 11) | public class FlattenLinkList { method flatten (line 13) | public void flatten(Node head) { method getTail (line 25) | private Node getTail(Node head) { method main (line 35) | public static void main(String args[]) { FILE: src/com/interview/linklist/InsertionSortLinkList.java class InsertionSortLinkList (line 13) | public class InsertionSortLinkList { method insert (line 15) | private Node insert(Node head,Node curr){ method sort (line 35) | public Node sort(Node head){ method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/linklist/LRUCache.java class LRUCache (line 15) | public class LRUCache { method LRUCache (line 22) | public LRUCache(int size){ method used (line 26) | public void used(int data){ method addIntoCache (line 41) | public void addIntoCache(int data){ method printCache (line 65) | public void printCache(){ method containsInCache (line 74) | public boolean containsInCache(int data) method deleteFromCache (line 79) | public void deleteFromCache(int data){ method main (line 106) | public static void main(String args[]){ FILE: src/com/interview/linklist/LRUCacheLeetCode.java class LRUCacheLeetCode (line 13) | public class LRUCacheLeetCode { method LRUCacheLeetCode (line 17) | public LRUCacheLeetCode(int capacity) { method get (line 22) | public int get(int key) { method set (line 27) | public void set(int key, int value) { class MyMap (line 31) | class MyMap extends LinkedHashMap { method MyMap (line 33) | MyMap(int capacity) { method removeEldestEntry (line 37) | @Override FILE: src/com/interview/linklist/LinkList.java class NodeRef (line 3) | class NodeRef{ method next (line 5) | public void next(){ class Node (line 10) | class Node{ method newNode (line 17) | public static Node newNode(int data, Object... obj){ class LinkList (line 30) | public class LinkList { method addNode (line 32) | public Node addNode(int data, Node head, Object... obj){ method addAtFront (line 52) | public Node addAtFront(Node node, Node head){ method reverse (line 60) | public Node reverse(Node head){ method reverseRecursiveEasy (line 73) | public Node reverseRecursiveEasy(Node head){ method reverseRecursive (line 84) | public void reverseRecursive(NodeRef headRef){ method addAtFront (line 101) | public Node addAtFront(int data, Node head){ method printList (line 106) | public void printList(Node head){ method find (line 113) | public Node find(Node head, int data){ method size (line 124) | public int size(Node head){ method main (line 132) | public static void main(String args[]){ FILE: src/com/interview/linklist/LinkListIsPalindrome.java class LinkListIsPalindrome (line 12) | public class LinkListIsPalindrome { method isPalindrome (line 14) | public boolean isPalindrome(NodeRef head,Node end){ method main (line 24) | public static void main(String args[]){ FILE: src/com/interview/linklist/LinkListToCompleteBinaryTree.java class LinkListToCompleteBinaryTree (line 11) | public class LinkListToCompleteBinaryTree { method convert (line 13) | public void convert(Node head){ method inorder (line 39) | public void inorder(Node head){ method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/linklist/LoopInLinkList.java class LoopInLinkList (line 14) | public class LoopInLinkList { method hasCycle (line 16) | public boolean hasCycle(Node head){ method main (line 36) | public static void main(String args[]){ FILE: src/com/interview/linklist/MergeForLargestSum.java class MergeForLargestSum (line 11) | public class MergeForLargestSum { method maxChain (line 13) | Node maxChain(Node head1, Node head2){ method main (line 87) | public static void main(String args[]){ FILE: src/com/interview/linklist/MergeSortLinkList.java class MergeSortLinkList (line 13) | public class MergeSortLinkList { method sort (line 15) | public Node sort(Node head, boolean isAscending){ method sortedMerge (line 26) | private Node sortedMerge(Node head1, Node head2, boolean isAscending){ method frontBackSplit (line 52) | private Node frontBackSplit(Node head){ method main (line 67) | public static void main(String args[]){ FILE: src/com/interview/linklist/MiddleElementOfLinkList.java class MiddleElementOfLinkList (line 11) | public class MiddleElementOfLinkList { method middle (line 13) | public int middle(Node head){ method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/linklist/MultiplyTwoNumbersLinkList.java class MultiplyTwoNumbersLinkList (line 9) | public class MultiplyTwoNumbersLinkList { method multiply (line 11) | public Node multiply(Node head1, Node head2){ method add (line 58) | private Node add(Node result, Node currentResult){ method main (line 124) | public static void main(String args[]){ FILE: src/com/interview/linklist/QuickSortSingleLinkList.java class HeadTail (line 13) | class HeadTail{ class QuickSortSingleLinkList (line 18) | public class QuickSortSingleLinkList { method quickSort (line 20) | public Node quickSort(Node head){ method quickSortFaster (line 61) | public Node quickSortFaster(Node head){ method quickSortUtil (line 71) | private HeadTail quickSortUtil(Node head){ method main (line 113) | public static void main(String args[]){ FILE: src/com/interview/linklist/RemoveDuplicatesSortedList.java class RemoveDuplicatesSortedList (line 12) | public class RemoveDuplicatesSortedList { method removeDuplicates (line 14) | public void removeDuplicates(Node head){ method main (line 28) | public static void main(String args[]){ FILE: src/com/interview/linklist/RemoveMiddleElementsOfLineSegment.java class Point (line 13) | class Point{ method Point (line 16) | Point(int x, int y){ class RemoveMiddleElementsOfLineSegment (line 22) | public class RemoveMiddleElementsOfLineSegment { method remove (line 24) | public void remove(Node head){ method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/linklist/ReorderList.java class ReorderList (line 9) | public class ReorderList { method reorderList (line 11) | public void reorderList(Node head) { method alternateMerge (line 18) | private Node alternateMerge(Node head1, Node head2) { method reverse (line 33) | private Node reverse(Node head) { method frontBackSplit (line 49) | private Node frontBackSplit(Node head) { FILE: src/com/interview/linklist/ReverseAlternateKNodes.java class ReverseAlternateKNodes (line 10) | public class ReverseAlternateKNodes { method reverse (line 12) | public Node reverse(Node head,int k,boolean reverse){ method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/linklist/ReverseAlternateNodeAndAppendAtEnd.java class ReverseAlternateNodeAndAppendAtEnd (line 8) | public class ReverseAlternateNodeAndAppendAtEnd { method act (line 10) | public void act(Node head){ method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/linklist/ReverseKNodes.java class ReverseKNodes (line 9) | public class ReverseKNodes { method reverse (line 11) | public Node reverse(Node head,int k){ method main (line 31) | public static void main(String args[]){ FILE: src/com/interview/linklist/RotateList.java class RotateList (line 12) | public class RotateList { method rotateRight (line 13) | public Node rotateRight(Node head, int k) { FILE: src/com/interview/linklist/ShuffleMerge.java class ShuffleMerge (line 18) | public class ShuffleMerge { method shuffleMergeRecursive (line 20) | public Node shuffleMergeRecursive(Node head1, Node head2){ method shuffleMerge (line 39) | public Node shuffleMerge(Node head1, Node head2){ method main (line 62) | public static void main(String args[]){ FILE: src/com/interview/linklist/SortNearlySortedList.java class SortNearlySortedList (line 15) | public class SortNearlySortedList { method sort (line 17) | public Node sort(Node head){ method mergeSort (line 35) | private Node mergeSort(Node head1,Node head2){ method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/linklist/SortedCircularLinkList.java class SortedCircularLinkList (line 12) | public class SortedCircularLinkList { method add (line 14) | public Node add(Node head,int data){ method getTail (line 44) | private Node getTail(Node head){ method printList (line 52) | public void printList(Node head){ method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/linklist/SortedLLToBalancedBST.java class SortedLLToBalancedBST (line 9) | public class SortedLLToBalancedBST { method toBalancedBST (line 11) | public Node toBalancedBST(Node head){ method toBalancedBST (line 19) | private Node toBalancedBST(NodeRef headRef, int size){ method printTreeInOrder (line 32) | public void printTreeInOrder(Node head){ method printTreePreOrder (line 41) | public void printTreePreOrder(Node head){ method main (line 50) | public static void main(String args[]){ FILE: src/com/interview/linklist/StackWithLinkListMiddleOperation.java class StackWithLinkListMiddleOperation (line 10) | public class StackWithLinkListMiddleOperation { method push (line 15) | public void push(int data){ method hasMore (line 32) | public boolean hasMore(){ method size (line 40) | public int size(){ method pop (line 44) | public int pop(){ method top (line 57) | public int top(){ method middle (line 63) | public int middle(){ method deleteMiddle (line 69) | public int deleteMiddle(){ method main (line 106) | public static void main(String args[]){ FILE: src/com/interview/linklist/SwapTwoNodesInDoubleLL.java class SwapTwoNodesInDoubleLL (line 11) | public class SwapTwoNodesInDoubleLL { method swap (line 13) | public void swap(Node nodeA, Node nodeB){ method main (line 73) | public static void main(String args[]){ FILE: src/com/interview/linklist/TripletToSumInLinkList.java class TripletToSumInLinkList (line 12) | public class TripletToSumInLinkList { method printTriplet (line 14) | public void printTriplet(Node head1, Node head2, Node head3,int sum){ method main (line 42) | public static void main(String args[]){ FILE: src/com/interview/misc/AddingTwoSetOfIntervals.java class AddingTwoSetOfIntervals (line 7) | public class AddingTwoSetOfIntervals { class Pair (line 9) | public static class Pair implements Comparable{ method Pair (line 12) | Pair(int low,int high){ method compareTo (line 16) | @Override method toString (line 25) | public String toString(){ method combineInterval (line 30) | public List combineInterval(Pair[] arr1, Pair[] arr2){ method main (line 80) | public static void main(String args[]){ FILE: src/com/interview/misc/AngleBetweenHourAndMinuteHand.java class AngleBetweenHourAndMinuteHand (line 6) | public class AngleBetweenHourAndMinuteHand { method angle (line 8) | public double angle(int hour, int min){ method main (line 16) | public static void main(String args[]){ FILE: src/com/interview/misc/BulbSwitcher.java class BulbSwitcher (line 11) | public class BulbSwitcher { method bulbSwitch (line 12) | public int bulbSwitch(int n) { FILE: src/com/interview/misc/CandiesProblem.java class CandiesProblem (line 23) | public class CandiesProblem { method minCandies (line 25) | public int minCandies(int ratings[]) { method main (line 77) | public static void main(String args[]) { FILE: src/com/interview/misc/ContainsNumberWithinKDistance.java class ContainsNumberWithinKDistance (line 23) | public class ContainsNumberWithinKDistance { method containsNearbyAlmostDuplicate (line 25) | public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) { FILE: src/com/interview/misc/ConvertNumberIntoBase26.java class ConvertNumberIntoBase26 (line 7) | public class ConvertNumberIntoBase26 { method numberToBase26 (line 9) | public String numberToBase26(int n) { method base26ToNumber (line 19) | public int base26ToNumber(String str) { method main (line 31) | public static void main(String args[]) { FILE: src/com/interview/misc/CountRanges.java class CountRanges (line 21) | public class CountRanges { method countRangeSum (line 23) | public int countRangeSum(int[] nums, int lower, int upper) { method main (line 49) | public static void main(String args[]) { FILE: src/com/interview/misc/DayDifferenceBetweenTwoDates.java class DayDifferenceBetweenTwoDates (line 8) | public class DayDifferenceBetweenTwoDates { method diff (line 12) | public int diff(int year1,int month1, int day1,int year2, int month2,i... method main (line 38) | public static void main(String args[]){ method isLeapYear (line 43) | public boolean isLeapYear(int year){ FILE: src/com/interview/misc/DifferenceBetweenTwoTime.java class DifferenceBetweenTwoTime (line 10) | public class DifferenceBetweenTwoTime { method diff (line 12) | public int diff(int time1, int time2){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/misc/FindingCelebrity.java class Relation (line 7) | class Relation { method knows (line 8) | boolean knows(int a, int b) { class FindingCelebrity (line 13) | public class FindingCelebrity extends Relation { method findCelebrity (line 15) | public int findCelebrity(int n) { FILE: src/com/interview/misc/FloatPointConversion.java class FloatPointConversion (line 11) | public class FloatPointConversion { method convert (line 13) | public double convert(String input){ method toDouble (line 29) | private double toDouble(String number){ method main (line 55) | public static void main(String args[]){ FILE: src/com/interview/misc/FourPointsFormSquare.java class Cordinate (line 3) | class Cordinate{ class FourPointsFormSquare (line 14) | public class FourPointsFormSquare { method isSquare (line 16) | public boolean isSquare(Cordinate[] cordinates){ method compare (line 34) | private boolean compare(Cordinate startPoint, Cordinate point1, Cordin... method distanceSquare (line 46) | private int distanceSquare(Cordinate c1, Cordinate c2){ method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/misc/GetKthPermutation.java class GetKthPermutation (line 9) | public class GetKthPermutation { method getPermutation (line 11) | public String getPermutation(int n, int k) { method factorial (line 42) | private int factorial(int n) { method main (line 50) | public static void main(String args[]) { FILE: src/com/interview/misc/HammingDistanceBetweenPair.java class HammingDistanceBetweenPair (line 9) | public class HammingDistanceBetweenPair { method hammingDistance (line 11) | public int hammingDistance(String input[]){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/misc/InsertInterval.java class InsertInterval (line 18) | public class InsertInterval { class Interval (line 20) | public static class Interval { method toString (line 24) | @Override method Interval (line 32) | Interval(int s, int e) { start = s; end = e; } method insert (line 35) | public List insert(List intervals, Interval newInt... method main (line 62) | public static void main(String args[]) { FILE: src/com/interview/misc/IntegerListParser.java class IntegerListParser (line 16) | public class IntegerListParser { method deserialize (line 18) | public NestedInteger deserialize(String s) { method serialize (line 55) | public String serialize(NestedInteger nestedInteger) { method serialize (line 61) | private void serialize(NestedInteger nestedInteger, StringBuffer resul... method main (line 82) | public static void main(String args[]) { class NestedInteger (line 113) | class NestedInteger { method NestedInteger (line 116) | public NestedInteger() { method NestedInteger (line 120) | public NestedInteger(int value) { method isInteger (line 124) | public boolean isInteger() { method getInteger (line 128) | public Integer getInteger() { method setInteger (line 132) | public void setInteger(int value) { method add (line 136) | public void add(NestedInteger ni) { method getList (line 140) | public List getList() { FILE: src/com/interview/misc/KthLargestInRowiseColumnWiseSorted2DArray.java class KthLargestInRowiseColumnWiseSorted2DArray (line 9) | public class KthLargestInRowiseColumnWiseSorted2DArray { method kthLargest (line 11) | public int kthLargest(int input[][],int k){ method main (line 42) | public static void main(String args[]){ FILE: src/com/interview/misc/LoadBalancers.java class LoadBalancers (line 8) | public class LoadBalancers { method addServer (line 13) | public void addServer(String name){ method removeServer (line 18) | public void removeServer(String name){ method getRandom (line 27) | public String getRandom(){ method main (line 32) | public static void main(String args[]){ FILE: src/com/interview/misc/NestedIterator.java class NestedIterator (line 21) | public class NestedIterator implements Iterator { method NestedIterator (line 24) | public NestedIterator(List nestedList) { method next (line 28) | @Override method hasNext (line 38) | @Override type NestedInteger (line 64) | interface NestedInteger { method isInteger (line 65) | boolean isInteger(); method getInteger (line 66) | Integer getInteger(); method getList (line 67) | List getList(); FILE: src/com/interview/misc/NumberToWord.java class NumberToWord (line 9) | public class NumberToWord { method numberToWords (line 15) | public String numberToWords(int number){ method hundredsPart (line 43) | private String hundredsPart(int number){ method tenthPart (line 62) | private String tenthPart(int number){ method toString (line 81) | private String toString(int number){ method main (line 153) | public static void main(String args[]){ FILE: src/com/interview/misc/PrimeNumbersBeforeN.java class PrimeNumbersBeforeN (line 9) | public class PrimeNumbersBeforeN { method primeNumbers (line 11) | public List primeNumbers(int n){ method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/misc/Read4Function.java class Read4 (line 16) | class Read4 { method read4 (line 17) | int read4(char[] buff) { class Read4Function (line 26) | public class Read4Function extends Read4{ class Queue (line 28) | class Queue { method Queue (line 34) | Queue(int size) { method isEmpty (line 39) | boolean isEmpty() { method offer (line 43) | void offer(char b) { method poll (line 49) | char poll() { method Read4Function (line 58) | public Read4Function() { method read (line 62) | public int read(char[] buf, int n) { method main (line 89) | public static void main(String args[]) { FILE: src/com/interview/misc/RomanNumberToDecimal.java class RomanNumberToDecimal (line 11) | public class RomanNumberToDecimal { method converToRoman (line 13) | public String converToRoman(int decimal){ method convertToDecimal (line 21) | public int convertToDecimal(char[] roman){ method literal (line 35) | private int literal(int decimal,StringBuffer buffer){ method literal (line 100) | private int literal(char ch){ method main (line 121) | public static void main(String args[]){ FILE: src/com/interview/misc/SparseTableRangeMinimumQuery.java class SparseTableRangeMinimumQuery (line 16) | public class SparseTableRangeMinimumQuery { method SparseTableRangeMinimumQuery (line 22) | public SparseTableRangeMinimumQuery(int[] input) { method preprocess (line 28) | private int[][] preprocess(int[] input, int n) { method rangeMinimumQuery (line 46) | public int rangeMinimumQuery(int low, int high) { method log2 (line 56) | private static int log2(int n){ method main (line 61) | public static void main(String args[]) { FILE: src/com/interview/multiarray/Fill2DMatrixWith1.java class Fill2DMatrixWith1 (line 6) | public class Fill2DMatrixWith1 { method fill (line 8) | public void fill(int input[][]){ method main (line 28) | public static void main(String args[]){ FILE: src/com/interview/multiarray/GameOfLife.java class GameOfLife (line 18) | public class GameOfLife { method gameOfLife (line 19) | public void gameOfLife(int[][] board) { method copyRow (line 42) | private void copyRow(int[] source, int[] dest) { method doesLive (line 48) | private boolean doesLive(int x, int y, int[][] board) { FILE: src/com/interview/multiarray/LongestConsecutiveIntegerInUnsorted2DArray.java class LongestConsecutiveIntegerInUnsorted2DArray (line 6) | public class LongestConsecutiveIntegerInUnsorted2DArray { method longestConsecutiveInteger (line 8) | public int longestConsecutiveInteger(int input[][]){ method DFS (line 23) | private int DFS(int input[][],int i,int j,boolean visited[][],int last... method main (line 43) | public static void main(String args[]){ FILE: src/com/interview/multiarray/MatrixCalculation.java class MatrixCalculation (line 3) | public class MatrixCalculation { method crossMultiply (line 7) | public String[][] crossMultiply(String[][] str){ method recur (line 25) | private void recur(StringBuffer buffer,String[][] result,String[][] st... method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/multiarray/MatrixFindAllSubSquareRectangleMatrix.java class MatrixFindAllSubSquareRectangleMatrix (line 6) | public class MatrixFindAllSubSquareRectangleMatrix { method printSumOfAllSquareMatrix (line 8) | public void printSumOfAllSquareMatrix(int input[][]){ method printSumOfAllRectangleMatrix (line 25) | public void printSumOfAllRectangleMatrix(int input[][]){ method main (line 42) | public static void main(String args[]){ FILE: src/com/interview/multiarray/MatrixInDiagonalOrder.java class MatrixInDiagonalOrder (line 6) | public class MatrixInDiagonalOrder { method printMatrix (line 8) | public void printMatrix(int [][]matrix){ method main (line 32) | public static void main(String args[]){ FILE: src/com/interview/multiarray/MatrixOf0sAnd1s.java class MatrixOf0sAnd1s (line 7) | public class MatrixOf0sAnd1s { method create (line 9) | public char[][] create(int n,int m){ method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/multiarray/MoveCellPerCellValue.java class Cell (line 8) | class Cell{ method Cell (line 11) | Cell(int x,int y){ class MoveCellPerCellValue (line 17) | public class MoveCellPerCellValue { method isAllCellTraversed (line 19) | public boolean isAllCellTraversed(Cell grid[][]){ method main (line 44) | public static void main(String args[]){ FILE: src/com/interview/multiarray/Mutable2DSumRangeQuery.java class Mutable2DSumRangeQuery (line 10) | public class Mutable2DSumRangeQuery { method Mutable2DSumRangeQuery (line 16) | public Mutable2DSumRangeQuery(int[][] matrix) { method update (line 32) | public void update(int row, int col, int val) { method sumRegion (line 40) | public int sumRegion(int row1, int col1, int row2, int col2) { FILE: src/com/interview/multiarray/RotateImage.java class RotateImage (line 12) | public class RotateImage { method rotate (line 14) | public void rotate(int[][] matrix) { method print (line 29) | private void print(int arr[][]){ method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/multiarray/ShortestDistanceFromAllBuildings.java class ShortestDistanceFromAllBuildings (line 18) | public class ShortestDistanceFromAllBuildings { class Point (line 19) | private class Point { method Point (line 21) | Point(int row, int col, int dist) { method shortestDistance (line 28) | public int shortestDistance(int[][] grid) { method getNeighbors (line 64) | private List getNeighbors(Point p, int[][] grid, boolean[][] vi... method main (line 78) | public static void main(String args[]) { FILE: src/com/interview/multiarray/SmallestRectangleBlackPixel.java class SmallestRectangleBlackPixel (line 10) | public class SmallestRectangleBlackPixel { method minArea (line 11) | public int minArea(char[][] image, int x, int y) { method searchColumns (line 25) | private int searchColumns(char[][] image, int i, int j, int top, int b... method searchRows (line 45) | private int searchRows(char[][] image, int i, int j, int left, int rig... method main (line 65) | public static void main(String args[]) { FILE: src/com/interview/multiarray/SpiralGeneration.java class SpiralGeneration (line 11) | public class SpiralGeneration { method generateMatrix (line 12) | public int[][] generateMatrix(int n) { method main (line 43) | public static void main(String args[]) { FILE: src/com/interview/multiarray/SpiralPrinting.java class SpiralPrinting (line 27) | public class SpiralPrinting { method spiralOrder (line 29) | public List spiralOrder(int[][] matrix) { method main (line 68) | public static void main(String args[]){ FILE: src/com/interview/multiarray/TilingProblem.java class Position (line 11) | class Position{ method Position (line 14) | Position(int x, int y){ method hashCode (line 18) | @Override method equals (line 26) | @Override class TilingProblem (line 44) | public class TilingProblem { method fit (line 47) | public char[][] fit(int size, Position missingPosition){ method fit (line 54) | private void fit(char matrix[][], Position topLeft, method determineQuadrant (line 74) | private Position determineQuadrant(Position topLeft, int size, Positio... method updateMatrix (line 86) | private void updateMatrix(char matrix[][], Position topLeft, Position ... method main (line 98) | public static void main(String args[]){ FILE: src/com/interview/multithreaded/BoundedBlockingQueue.java class BoundedBlockingQueue (line 21) | public class BoundedBlockingQueue { method BoundedBlockingQueue (line 35) | public BoundedBlockingQueue(int size){ method poll (line 46) | public Optional poll(long timeout, TimeUnit timeUnit) throws Interr... method offer (line 81) | public boolean offer(T t, long timeout, TimeUnit timeUnit) throws Inte... method enqueue (line 109) | private void enqueue(T t){ method dequeue (line 117) | @SuppressWarnings("unchecked") method main (line 128) | public static void main(String args[]) throws Exception{ method verifyQueueWorks (line 132) | public static void verifyQueueWorks() throws Exception{ FILE: src/com/interview/multithreaded/CountingWord.java class CountingWord (line 29) | public class CountingWord { method addWord (line 33) | public void addWord(String word){ method getCount (line 46) | public long getCount(String word){ method main (line 54) | public static void main(String args[]) throws InterruptedException{ FILE: src/com/interview/multithreaded/DependencyTaskExecutor.java class DependencyTaskExecutor (line 19) | public class DependencyTaskExecutor { method scheduleTask (line 22) | void scheduleTask(List tasks, int threads) { method scheduleTaskUtil (line 31) | CompletableFuture scheduleTaskUtil(Task task, Executor executor) { method main (line 50) | public static void main(String args[]) { type Task (line 71) | interface Task { method name (line 72) | String name(); method dependencies (line 73) | List dependencies(); method execute (line 74) | void execute(); class SimpleSleepTask (line 77) | class SimpleSleepTask implements Task { method SimpleSleepTask (line 81) | SimpleSleepTask(String name, int sleepTimeInMillis) { method addDependency (line 86) | void addDependency(Task task) { method name (line 90) | @Override method dependencies (line 95) | @Override method execute (line 100) | @Override class FutureTask (line 112) | class FutureTask implements Runnable { method FutureTask (line 117) | FutureTask(Task task, Executor executor) { method run (line 121) | @Override method supplyAsync (line 129) | void supplyAsync(FutureTask task, Executor executor) { method addChain (line 133) | void addChain(FutureTask task) { FILE: src/com/interview/multithreaded/FillupMatrix.java class FillupMatrix (line 27) | public class FillupMatrix { method FillupMatrix (line 32) | public FillupMatrix(int size){ method updateMatrix (line 38) | public void updateMatrix(){ method updateMatrix (line 43) | private void updateMatrix(long pos){ method next (line 50) | private long next(){ method getVal (line 55) | public boolean getVal(int x, int y){ method main (line 59) | public static void main(String args[]) throws InterruptedException{ FILE: src/com/interview/multithreaded/MinMaxKeeper.java class MinMaxKeeper (line 24) | public class MinMaxKeeper { method updateMinMax (line 33) | public void updateMinMax(int value){ method getMin (line 62) | public int getMin(){ method getMax (line 66) | public int getMax(){ method main (line 70) | public static void main(String args[]) throws InterruptedException{ class GenerateRand (line 86) | static class GenerateRand implements Runnable{ method GenerateRand (line 89) | public GenerateRand(MinMaxKeeper mmKeeper, int index) { method run (line 93) | @Override FILE: src/com/interview/multithreaded/PrintInSequence.java class PrintInSequence (line 10) | public class PrintInSequence { method increment (line 16) | public void increment() { method decrement (line 28) | public void decrement() { method printVar (line 41) | public void printVar() { method main (line 48) | public static void main(String args[]) { method runIncrement (line 62) | private void runIncrement() { method runPrint (line 68) | private void runPrint() { method runDecrement (line 74) | private void runDecrement() { FILE: src/com/interview/multithreaded/RealTimeCounter.java class RealTimeCounter (line 28) | public class RealTimeCounter { method RealTimeCounter (line 34) | private RealTimeCounter(){ method getInstance (line 41) | public static RealTimeCounter getInstance(){ method getTotalEvents (line 52) | public long getTotalEvents(){ method addEvent (line 60) | public void addEvent(){ method incrementPosition (line 64) | void incrementPosition(){ method main (line 70) | public static void main(String args[]){ class PositionUpdater (line 98) | class PositionUpdater extends TimerTask{ method PositionUpdater (line 103) | PositionUpdater(RealTimeCounter realTimeCounter) { method start (line 107) | public void start(){ method run (line 110) | @Override FILE: src/com/interview/multithreaded/SingleQueueDomainTableUpdate.java class Data (line 16) | class Data{ method getUpdate (line 19) | public String getUpdate() { method getDomain (line 22) | public String getDomain() { type DomainLock (line 27) | interface DomainLock{ method acquireLock (line 28) | boolean acquireLock(String domain); method releaseLock (line 29) | boolean releaseLock(String domain); method isLocked (line 30) | boolean isLocked(String domain); class ThreadPoolManager (line 33) | class ThreadPoolManager{ method ThreadPoolManager (line 35) | public ThreadPoolManager(int numOfThreads){ type DatabaseLayer (line 40) | interface DatabaseLayer{ method applyUpdates (line 41) | public void applyUpdates(String domain,String update); class ThreadWorker (line 44) | class ThreadWorker implements Runnable{ method ThreadWorker (line 50) | public ThreadWorker(QueueManager mgr){ method run (line 53) | @Override type QueueHandle (line 87) | interface QueueHandle{ method getNextData (line 89) | public Data getNextData(); class Pair (line 92) | class Pair{ class QueueManager (line 97) | class QueueManager{ method QueueManager (line 99) | public QueueManager(QueueHandle queueHandle){ method getDataFromFrontOfQueue (line 103) | public synchronized Pair getDataFromFrontOfQueue(DomainLock domainLock){ class SingleQueueDomainTableUpdate (line 117) | public class SingleQueueDomainTableUpdate { FILE: src/com/interview/multithreaded/SpinLockMutex.java class Mutex (line 6) | class Mutex { method ice (line 18) | private synchronized int ice(int oldValue, int newValue) { method acquireLock (line 27) | void acquireLock() { method releaseLock (line 31) | void releaseLock() { class SpinLockMutex (line 37) | public class SpinLockMutex { method changeBuffer (line 42) | public void changeBuffer(String str) { method getBuffer (line 46) | public String getBuffer() { method main (line 50) | public static void main(String args[]) throws Exception{ FILE: src/com/interview/multithreaded/ThreadPoolExample.java class ThreadPoolExample (line 14) | public class ThreadPoolExample { method doWork (line 18) | public void doWork() throws Exception{ method main (line 30) | public static void main(String args[]) throws Exception{ class Count10 (line 37) | class Count10 implements Callable{ method Count10 (line 40) | Count10(int i){ method call (line 43) | @Override FILE: src/com/interview/multithreaded/ThreadPoolImpl.java class ThreadPool (line 6) | class ThreadPool { method run (line 8) | public Thread run(Runnable runnable) { class ThreadPoolImpl (line 22) | public class ThreadPoolImpl { method ThreadPoolImpl (line 27) | public ThreadPoolImpl(int size, ThreadPool threadPool) { method setMax (line 32) | public void setMax(int size){ method run (line 47) | public void run(Runnable thread) { method execute (line 54) | private void execute() { class ExecutingRunnable (line 62) | class ExecutingRunnable implements Runnable { method run (line 63) | @Override class RunnableThreads (line 98) | class RunnableThreads implements Runnable { method RunnableThreads (line 101) | RunnableThreads(Runnable r) { method run (line 105) | @Override method main (line 112) | public static void main(String args[]) throws InterruptedException{ class MyRunnable (line 131) | class MyRunnable implements Runnable{ method MyRunnable (line 133) | MyRunnable(int index){ method run (line 136) | @Override FILE: src/com/interview/number/AggregateNumber.java class AggregateNumber (line 7) | public class AggregateNumber { method isAggregate (line 10) | public boolean isAggregate(int[] number){ method getNumber (line 45) | private int getNumber(int[] number, int start, int end){ method main (line 54) | public static void main(String args[]){ FILE: src/com/interview/number/AllStrobogrammaticNumber.java class AllStrobogrammaticNumber (line 12) | public class AllStrobogrammaticNumber { method strobogrammaticInRange (line 15) | public int strobogrammaticInRange(String low, String high) { method strobogrammaticInRangeUtil (line 24) | private int strobogrammaticInRangeUtil(String low, String high, int le... FILE: src/com/interview/number/ArithemeticProgressionExists.java class ArithemeticProgressionExists (line 6) | public class ArithemeticProgressionExists { method exists (line 8) | public boolean exists(int input[]){ method main (line 25) | public static void main(String args[]){ FILE: src/com/interview/number/ArrayMultiplication.java class ArrayMultiplication (line 5) | public class ArrayMultiplication { method multiplyDivideAndConquer (line 7) | public int[] multiplyDivideAndConquer(int arr1[],int arr2[],int low1,i... method shift (line 38) | private int[] shift(int arr[],int n){ method simpleMultiplication (line 47) | public int[] simpleMultiplication(int arr1[],int arr2[],int low1,int h... method addToResult (line 75) | private void addToResult(int[] result,int temp[],int start){ method multiplicationImproved (line 87) | public int multiplicationImproved(int x, int y, int len){ method power (line 102) | private int power(int n){ method main (line 107) | public static void main(String args[]){ FILE: src/com/interview/number/BasicCalculator.java class BasicCalculator (line 18) | public class BasicCalculator { method calculate (line 19) | public int calculate(String s) { FILE: src/com/interview/number/BinomialCoefficient.java class BinomialCoefficient (line 10) | public class BinomialCoefficient { method calculate (line 12) | public int calculate(int n, int k){ method main (line 24) | public static void main(String args[]){ FILE: src/com/interview/number/ConvertToBaseN.java class ConvertToBaseN (line 3) | public class ConvertToBaseN { method baseN (line 5) | int baseN(int num,int base){ method main (line 19) | public static void main(String args[]){ FILE: src/com/interview/number/CountNoOf2s.java class CountNoOf2s (line 6) | public class CountNoOf2s { method count2s (line 8) | public int count2s(int n){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/number/CountNumbersNotIncluding4.java class CountNumbersNotIncluding4 (line 6) | public class CountNumbersNotIncluding4 { method count (line 8) | public int count(int n){ method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/number/DivisionWithoutDivisionOperator.java class DivisionWithoutDivisionOperator (line 3) | public class DivisionWithoutDivisionOperator { class Pair (line 5) | public static class Pair { method divide (line 10) | public Pair divide(int number, int divisor) { method divideRec (line 22) | public int divideRec(int number, int divisor){ method efficientDivide (line 30) | public Pair efficientDivide(int divident, int divisor) { method efficientDivideRec (line 54) | public int efficientDivideRec(int divident, int divisor){ method main (line 69) | public static void main(String args[]) { FILE: src/com/interview/number/EuclideanAlgoForGCD.java class EuclideanAlgoForGCD (line 7) | public class EuclideanAlgoForGCD { method gcd (line 9) | public int gcd(int num1, int num2){ method gcdRec (line 26) | public int gcdRec(int num1, int num2){ method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/number/FactorialOfLargeNumber.java class FactorialOfLargeNumber (line 23) | public class FactorialOfLargeNumber { method calculate (line 25) | public int calculate(int result[], int n){ method multiply (line 35) | private int multiply(int result[], int x, int size){ method main (line 55) | public static void main(String args[]){ FILE: src/com/interview/number/GenerateSignature.java class GenerateSignature (line 14) | public class GenerateSignature { method generate (line 16) | public int[] generate(char[] input) { method reverse (line 41) | private void reverse(int[] result, int start, int end) { method main (line 52) | public static void main(String args[]){ FILE: src/com/interview/number/LargestMultipleOf3inArray.java class LargestMultipleOf3inArray (line 10) | public class LargestMultipleOf3inArray { method swap (line 12) | public void swap(int input[],int i, int j){ method reverse (line 17) | private void reverse(int input[]){ method largestMultiple (line 23) | public int[] largestMultiple(int input[]){ method main (line 111) | public static void main(String args[]){ FILE: src/com/interview/number/LuckyNumbers.java class LuckyNumbers (line 6) | public class LuckyNumbers { method isLuck (line 8) | public boolean isLuck(int n,int counter){ method main (line 19) | public static void main(String args[]){ FILE: src/com/interview/number/MedianOf3Number.java class MedianOf3Number (line 3) | public class MedianOf3Number { method median (line 5) | public int median(int arr[]){ method median2Comparison (line 26) | public int median2Comparison(int arr[]){ method medianXORMethod (line 40) | public int medianXORMethod(int arr[]){ method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/number/MthNumberInNSizeArray.java class MthNumberInNSizeArray (line 12) | public class MthNumberInNSizeArray { method find (line 14) | public int[] find(int n, int m) { method find (line 21) | private void find(int result[], boolean used[], int start, int n, int ... method binarySearch (line 33) | private int binarySearch(int m, int start, int end, int factorial) { method fillupRemaining (line 48) | private void fillupRemaining(int result[], boolean used[], int index) { method nthUnused (line 62) | private int nthUnused(boolean used[], int n) { method factorial (line 75) | private int factorial(int n) { method main (line 83) | public static void main(String args[]) { FILE: src/com/interview/number/NBy2PairSumToK.java class NBy2PairSumToK (line 8) | public class NBy2PairSumToK { method pair (line 12) | public boolean pair(int input[],int k){ method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/number/NextLargestPalindrome.java class NextLargestPalindrome (line 6) | public class NextLargestPalindrome { method nextPalindrome (line 8) | public void nextPalindrome(int num[]){ method printArray (line 54) | public void printArray(int num[]){ method main (line 60) | public static void main(String args[]){ FILE: src/com/interview/number/NotIncluding4.java class NotIncluding4 (line 10) | public class NotIncluding4 { method number (line 12) | public int number(int chinaNumber){ method main (line 31) | public static void main(String args[]){ FILE: src/com/interview/number/NumberOfCombinationsForStairs.java class NumberOfCombinationsForStairs (line 14) | public class NumberOfCombinationsForStairs { method numberOfWays (line 19) | public int numberOfWays(int n,int k){ method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/number/PermutationBiggerThanNumber.java class PermutationBiggerThanNumber (line 18) | public class PermutationBiggerThanNumber { method nextPermutation (line 20) | public void nextPermutation(int[] nums) { method reverse (line 37) | private void reverse(int nums[], int start, int end) { method ceiling (line 47) | private int ceiling(int val, int start, int end, int[] nums) { method main (line 61) | public static void main(String args[]){ FILE: src/com/interview/number/PermutationLargerThanGivenArray.java class PermutationLargerThanGivenArray (line 11) | public class PermutationLargerThanGivenArray { method findBiggerNumber (line 13) | public int[] findBiggerNumber(int src[],int dest[]){ method sortRemaining (line 23) | private void sortRemaining(int src[],int result[],boolean used[],int p... method findNumber (line 34) | private boolean findNumber(int src[],int dest[],int result[],int pos,b... method main (line 79) | public static void main(String args[]){ FILE: src/com/interview/number/PowerFunction.java class PowerFunction (line 15) | public class PowerFunction { method power (line 17) | public int power(int n, int m){ method powerUsingBit (line 30) | public double powerUsingBit(double x, int n) { method main (line 53) | public static void main(String args[]){ FILE: src/com/interview/number/RearrangeNumberInArrayToFormLargestNumber.java class RearrangeNumberInArrayToFormLargestNumber (line 12) | public class RearrangeNumberInArrayToFormLargestNumber { method largestNumber (line 14) | public String largestNumber(int[] nums) { method main (line 41) | public static void main(String args[]){ class IntegerComparator (line 51) | class IntegerComparator implements Comparator { method compare (line 52) | @Override FILE: src/com/interview/number/RussianPeasantMultiplication.java class RussianPeasantMultiplication (line 9) | public class RussianPeasantMultiplication { method multiply (line 11) | public int multiply(int a,int b){ method main (line 23) | public static void main(String args[]){ FILE: src/com/interview/number/SmallestNumberGreaterThanGiveNumberIncreasingSequence.java class SmallestNumberGreaterThanGiveNumberIncreasingSequence (line 13) | public class SmallestNumberGreaterThanGiveNumberIncreasingSequence { method getNextInt (line 15) | public int[] getNextInt(int []input){ method getNextInt (line 27) | private boolean getNextInt(int input[], int result[], int pos){ method fillRestOfArray (line 67) | private void fillRestOfArray(int result[],int pos,int val){ method getHigherNumber (line 74) | private int getHigherNumber(int input, int i, int len){ method main (line 81) | public static void main(String args[]){ FILE: src/com/interview/number/SquareRoot.java class SquareRoot (line 6) | public class SquareRoot { method findRoot (line 8) | double findRoot(int num){ method main (line 19) | public static void main(String args[]){ FILE: src/com/interview/number/StrobogrammaticNumber.java class StrobogrammaticNumber (line 7) | public class StrobogrammaticNumber { method isStrobogrammatic (line 8) | public boolean isStrobogrammatic(String num) { FILE: src/com/interview/number/Trailing0sinFactorial.java class Trailing0sinFactorial (line 9) | public class Trailing0sinFactorial { method trailing0s (line 11) | public int trailing0s(int num){ method main (line 21) | public static void main(String args[]){ FILE: src/com/interview/number/UniquePartitionOfInteger.java class UniquePartitionOfInteger (line 11) | public class UniquePartitionOfInteger { method partition (line 13) | public void partition(int n){ method partition (line 18) | private void partition(int n, int max,List result){ method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/playground/TestInnerClass.java class TestInnerClass (line 8) | public class TestInnerClass { method test (line 12) | public Okay test() { method test1 (line 19) | public void test1() { method main (line 28) | public static void main(String args[]) { type Okay (line 34) | interface Okay { method next (line 35) | int next(); FILE: src/com/interview/random/Rand7UsingRand5.java class Rand7UsingRand5 (line 3) | public class Rand7UsingRand5 { method rand7 (line 5) | public int rand7(){ method rand5 (line 13) | private int rand5(){ method main (line 17) | public static void main(String args[]){ FILE: src/com/interview/random/RandomCountrySelectionByPopluation.java class RandomCountrySelectionByPopluation (line 3) | public class RandomCountrySelectionByPopluation { method getRandom (line 5) | public int getRandom(int []arr){ method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/random/SelectMRandomNumbersInStream.java class SelectMRandomNumbersInStream (line 7) | public class SelectMRandomNumbersInStream { method selectRandom (line 9) | public int[] selectRandom(int arr[],int m){ method main (line 24) | public static void main(String args[]){ FILE: src/com/interview/random/ShuffleArray.java class ShuffleArray (line 7) | public class ShuffleArray { method shuffle (line 9) | public void shuffle(int arr[]){ method swap (line 17) | private void swap(int arr[],int a,int b){ method main (line 23) | public static void main(String args[]){ FILE: src/com/interview/recursion/AllAdjacentCombination.java class AllAdjacentCombination (line 14) | public class AllAdjacentCombination { method combination (line 16) | public void combination(int input[],int result[],int k,int pos,int r){ method formNumber (line 31) | private int formNumber(int input[], int start, int end){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/recursion/Bracketology.java class Bracketology (line 6) | public class Bracketology { method matchBracket (line 8) | public boolean matchBracket(char str[],int openCount,int pos){ method printArray (line 30) | private void printArray(char result[]){ method bracketPermutation (line 37) | public void bracketPermutation(char result[],int n, int pos,int openCo... method matchBracket (line 52) | public boolean matchBracket(char []brackets){ method getOpeningCharacter (line 74) | private Character getOpeningCharacter(char ch){ method main (line 85) | public static void main(String args[]){ FILE: src/com/interview/recursion/ChainWordsToFormCircle.java class ChainWordsToFormCircle (line 15) | public class ChainWordsToFormCircle { method formCircle (line 17) | public List formCircle(String input[]){ method formCircle (line 31) | private boolean formCircle(String input[], List result,boolean... method main (line 61) | public static void main(String args[]){ FILE: src/com/interview/recursion/Combination.java class Combination (line 5) | public class Combination { method combination (line 7) | public void combination(char input[]){ method combination (line 30) | private void combination(char input[],int count[],int pos, char output... method print (line 43) | private void print(char result[],int pos){ method combinationEasy (line 50) | public void combinationEasy(char[] input) { method combinationEasy (line 56) | private void combinationEasy(char[] input, int pos, List r) { method main (line 70) | public static void main(String args[]){ FILE: src/com/interview/recursion/CombinationOfSizeK.java class CombinationOfSizeK (line 6) | public class CombinationOfSizeK { method combination (line 8) | public void combination(int arr[],int k){ method combinationUtil (line 13) | private void combinationUtil(int arr[],int k, int pos,int result[],int... method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/recursion/CombinationWithStar.java class CombinationWithStar (line 16) | public class CombinationWithStar { method combine (line 18) | public void combine(char input[], int pos, boolean used[]){ method printArray (line 27) | private void printArray(char result[], boolean used[]){ method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/recursion/DifferentWaysToAddParentheses.java class DifferentWaysToAddParentheses (line 8) | public class DifferentWaysToAddParentheses { method diffWaysToCompute (line 9) | public List diffWaysToCompute(String str) { method diffWaysToComputeUtil (line 24) | private List diffWaysToComputeUtil(List operands, Li... method operate (line 46) | private long operate(int val1, int val2, char op) { method main (line 58) | public static void main(String args[]) { FILE: src/com/interview/recursion/FancyShuffle.java class FancyShuffle (line 18) | public class FancyShuffle { method shuffle (line 20) | public char[] shuffle(char input[]){ method shuffleUtil (line 49) | private boolean shuffleUtil(char input[], int freq[], char result[], i... method main (line 71) | public static void main(String args[]) { FILE: src/com/interview/recursion/InterpretationOfArray.java class InterpretationOfArray (line 9) | public class InterpretationOfArray { method interpret (line 11) | public void interpret(int arr[]){ method interpret (line 28) | private void interpret(int len,int pos,List result,char[][]... method print (line 47) | private void print(List result){ method getRepresentation (line 54) | private char getRepresentation(int number){ method main (line 61) | public static void main(String args[]){ FILE: src/com/interview/recursion/KeyPadPermutation.java class KeyPadPermutation (line 6) | public class KeyPadPermutation { method permute (line 8) | public void permute(int input[]) { method permute (line 13) | private void permute(int input[], int pos, char result[]) { method getCharSetForNumber (line 29) | private char[] getCharSetForNumber(int num) { method main (line 43) | public static void main(String args[]){ FILE: src/com/interview/recursion/LongestAbsolutePath.java class LongestAbsolutePath (line 26) | public class LongestAbsolutePath { method lengthLongestPath (line 27) | public int lengthLongestPath(String input) { method lengthLongestPath (line 40) | public int lengthLongestPath(Queue queue, Node root, int current... class Node (line 60) | class Node { method Node (line 64) | Node(String file, int level) { method Node (line 68) | Node(String file) { method lengthLongestPathIterative (line 84) | public int lengthLongestPathIterative(String input) { FILE: src/com/interview/recursion/MinimumEditForReversePolishNotation.java class MinimumEditForReversePolishNotation (line 6) | public class MinimumEditForReversePolishNotation { method minimum (line 8) | public int minimum(char input[]){ method minimum (line 12) | private int minimum(char input[],int pos,int countXs){ method main (line 48) | public static void main(String args[]){ FILE: src/com/interview/recursion/NQueenProblem.java class NQueenProblem (line 19) | public class NQueenProblem { class Position (line 21) | class Position { method Position (line 23) | Position(int row, int col) { method solveNQueenOneSolution (line 29) | public Position[] solveNQueenOneSolution(int n) { method solveNQueenOneSolutionUtil (line 39) | private boolean solveNQueenOneSolutionUtil(int n, int row, Position[] ... method solveNQueens (line 68) | public List> solveNQueens(int n) { method solve (line 75) | public void solve(int current, Position[] positions, List... method main (line 110) | public static void main(String args[]) { FILE: src/com/interview/recursion/OneEditApart.java class OneEditApart (line 14) | public class OneEditApart { method isOneEditDistance (line 16) | public boolean isOneEditDistance(String s, String t) { method main (line 52) | public static void main(String args[]){ FILE: src/com/interview/recursion/OperatorAdditionForTarget.java class OperatorAdditionForTarget (line 14) | public class OperatorAdditionForTarget { method addOperators (line 15) | public List addOperators(String num, int target) { method dfs (line 25) | private void dfs(String nums, int pos, int target, long runningTotal, ... method main (line 55) | public static void main(String args[]) { FILE: src/com/interview/recursion/OptimalDivision.java class OptimalDivision (line 9) | public class OptimalDivision { method optimalDivision (line 10) | public String optimalDivision(int[] nums) { method optimalDivison (line 16) | private Result optimalDivison(int[] nums, int start, int end, boolean ... class Result (line 55) | class Result { method Result (line 58) | Result(double val, String str) { method main (line 64) | public static void main(String args[]) { FILE: src/com/interview/recursion/PrintAllPathFromTopLeftToBottomRight.java class PrintAllPathFromTopLeftToBottomRight (line 8) | public class PrintAllPathFromTopLeftToBottomRight { method print (line 11) | public void print(int arr[][],int row, int col,int result[],int pos){ method main (line 26) | public static void main(String args[]){ FILE: src/com/interview/recursion/PrintAllSubsequence.java class PrintAllSubsequence (line 12) | public class PrintAllSubsequence { method print (line 13) | public void print(int[] input) { method print (line 21) | private void print(int[] input, int[] output, int len, int current, bo... method main (line 39) | public static void main(String args[]) { FILE: src/com/interview/recursion/PrintArrayInAdjacentWay.java class PrintArrayInAdjacentWay (line 24) | public class PrintArrayInAdjacentWay { method printArray (line 26) | public void printArray(int len,int k){ method printArray (line 31) | private void printArray(int len, int pos,List result,int k){ method numberOfWaysPossible (line 50) | public int numberOfWaysPossible(int input[],int pos){ method numberOfWaysPossibleFaster (line 76) | public int numberOfWaysPossibleFaster(int input[]){ method main (line 92) | public static void main(String args[]){ FILE: src/com/interview/recursion/PrintArrayInCustomizedFormat.java class PrintArrayInCustomizedFormat (line 9) | public class PrintArrayInCustomizedFormat { method print (line 11) | void print(char str[][]){ method DFS (line 26) | private void DFS(char str[][],int pos,int distance,Map> combinationSum(int[] candidates, int target) { method combinationSumUtil (line 38) | private void combinationSumUtil(int[] candidates, int target, List findItinerary(String[][] tickets) { method findItineraryUtil (line 28) | boolean findItineraryUtil(List input, boolean[] used, Strin... class Itinerary (line 51) | class Itinerary implements Comparable { method Itinerary (line 54) | Itinerary(String start, String dest) { method compareTo (line 59) | @Override method main (line 69) | public static void main(String args[]) { FILE: src/com/interview/recursion/RemoveInvalidParenthesis.java class RemoveInvalidParenthesis (line 15) | public class RemoveInvalidParenthesis { method removeInvalidParentheses (line 17) | public List removeInvalidParentheses(String s) { method DFS (line 31) | public void DFS(Set res, String s, int i, int rmL, int rmR, in... method main (line 56) | public static void main(String args[]) { FILE: src/com/interview/recursion/RestoreIPAddresses.java class RestoreIPAddresses (line 14) | public class RestoreIPAddresses { method restoreIpAddresses (line 15) | public List restoreIpAddresses(String s) { method restoreIpAddressesUtil (line 22) | private void restoreIpAddressesUtil(String s, int start, int count, Li... FILE: src/com/interview/recursion/SetPairTogether.java class SetPairTogether (line 17) | public class SetPairTogether { method findMinimumSwaps (line 19) | public int findMinimumSwaps(int input[], Map pair) { method findMinimumSwapsUtil (line 27) | public int findMinimumSwapsUtil(int input[], Map pai... method swap (line 57) | private void swap(Map index, int input[], int i, int... method main (line 66) | public static void main(String args[]) { FILE: src/com/interview/recursion/StringInterleaving.java class StringInterleaving (line 3) | public class StringInterleaving { method printArray (line 5) | private void printArray(char[] str){ method interleaving (line 12) | public void interleaving(char[] str1,char[] str2,int len1,int len2,int... method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/recursion/StringPermutation.java class StringPermutation (line 15) | public class StringPermutation { method permute (line 17) | public List permute(char input[]) { method permuteUtil (line 42) | public void permuteUtil(char str[], int count[], char result[], int le... method printArray (line 59) | private void printArray(char input[]) { method main (line 66) | public static void main(String args[]) { FILE: src/com/interview/recursion/StringPermutationRotation.java class StringPermutationRotation (line 3) | public class StringPermutationRotation { method swap (line 5) | private void swap(char arr[],int i, int j){ method printArray (line 11) | private void printArray(char str[]){ method permute (line 18) | public void permute(char[] str,int pos){ method main (line 30) | public static void main(String args[]){ FILE: src/com/interview/recursion/SudokuSolver.java class SudokuSolver (line 13) | public class SudokuSolver { method solveSudoku (line 15) | public void solveSudoku(char[][] input) { method solveSudokuUtil (line 33) | private boolean solveSudokuUtil(char[][] input, boolean[][] horizontal... method main (line 65) | public static void main(String args[]) { FILE: src/com/interview/recursion/WordCombination.java class WordCombination (line 18) | public class WordCombination { method printCombinations (line 20) | public void printCombinations(List> input) { method print (line 25) | private void print(List> input, int[] result, int pos) { method main (line 42) | public static void main(String args[]){ FILE: src/com/interview/recursion/WordPattern.java class WordPattern (line 14) | public class WordPattern { method wordPatternMatch (line 15) | public boolean wordPatternMatch(String pattern, String str) { method wordPatternMatch (line 21) | public boolean wordPatternMatch(String pattern, String str, int pos1, ... method main (line 48) | public static void main(String args[]) { FILE: src/com/interview/regex/MultiSpaceReplacement.java class MultiSpaceReplacement (line 6) | public class MultiSpaceReplacement { method replace (line 8) | public void replace(String str){ method main (line 15) | public static void main(String args[]){ FILE: src/com/interview/sort/CountingSort.java class CountingSort (line 3) | public class CountingSort { method sort (line 7) | public void sort(int arr[]) { method sort1 (line 23) | public void sort1(int arr[]) { method main (line 45) | public static void main(String args[]) { FILE: src/com/interview/sort/HeapSort.java class HeapSort (line 25) | public class HeapSort { method sort (line 27) | public void sort(int arr[]){ method heapify (line 38) | private void heapify(int arr[], int end){ method swap (line 64) | private void swap(int arr[], int x, int y){ method heapAdd (line 70) | private void heapAdd(int arr[], int end){ method main (line 82) | public static void main(String args[]){ FILE: src/com/interview/sort/IterativeQuickSort.java class IterativeQuickSort (line 11) | public class IterativeQuickSort { method sort (line 13) | public void sort(int arr[]){ method partition (line 41) | private int partition(int arr[], int low,int high){ method swap (line 57) | private void swap(int arr[],int a,int b){ method main (line 63) | public static void main(String args[]){ FILE: src/com/interview/sort/MergeSort.java class MergeSort (line 12) | public class MergeSort { method sort (line 14) | public void sort(int input[]){ method sort (line 18) | private void sort(int input[], int low, int high){ method sortedMerge (line 29) | private void sortedMerge(int input[], int low, int high){ method printArray (line 55) | public void printArray(int input[]){ method main (line 62) | public static void main(String args[]){ FILE: src/com/interview/sort/PanCakeSorting.java class PanCakeSorting (line 17) | public class PanCakeSorting { method sort (line 19) | public void sort(int arr[]){ method findMax (line 27) | private int findMax(int arr[],int pos){ method flip (line 37) | private void flip(int arr[],int pos){ method swap (line 43) | private void swap(int arr[],int i,int j){ method main (line 49) | public static void main(String args[]){ FILE: src/com/interview/sort/QuickSort.java class QuickSort (line 3) | public class QuickSort { method swap (line 5) | private void swap(int A[],int i,int j) method split (line 11) | private int split(int A[],int low,int high) method split1 (line 37) | private int split1(int A[],int low,int high){ method sort (line 62) | public void sort(int A[],int low,int high) method printArray (line 73) | private void printArray(int arr[]){ method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/sort/RadixSort.java class RadixSort (line 3) | public class RadixSort { method countSort (line 5) | private void countSort(int arr[],int exp){ method max (line 28) | private int max(int arr[]){ method radixSort (line 38) | public void radixSort(int arr[]){ method main (line 46) | public static void main(String args[]){ FILE: src/com/interview/sort/Sort0toN3.java class Sort0toN3 (line 6) | public class Sort0toN3 { method sort (line 8) | public void sort(int arr[],int n){ method sort (line 15) | private void sort(int arr[],int n, int exp){ method main (line 36) | public static void main(String args[]){ FILE: src/com/interview/sort/SortArrayByFrequence.java class SortArrayByFrequence (line 11) | public class SortArrayByFrequence { class SortNode (line 13) | class SortNode{ class FrequenceComparator (line 18) | class FrequenceComparator implements Comparator{ method FrequenceComparator (line 20) | FrequenceComparator(Map countMap){ method compare (line 23) | @Override method sortByFrequence (line 38) | public void sortByFrequence(Integer arr[]){ method main (line 58) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/CircularQueue.java class CircularQueue (line 3) | public class CircularQueue { method CircularQueue (line 7) | public CircularQueue(int size){ method offer (line 13) | public void offer(T t){ method top (line 26) | public T top(){ method poll (line 34) | public T poll(){ method isEmpty (line 50) | public boolean isEmpty(){ method isFull (line 57) | public boolean isFull(){ method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/MaximumHistogram.java class MaximumHistogram (line 38) | public class MaximumHistogram { method maxHistogram (line 40) | public int maxHistogram(int input[]){ method main (line 88) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/MedianFinder.java class MedianFinder (line 14) | public class MedianFinder { method MedianFinder (line 19) | public MedianFinder() { method addNum (line 25) | public void addNum(int num) { method findMedian (line 49) | public double findMedian() { method main (line 57) | public static void main(String args[]) { FILE: src/com/interview/stackqueue/RealTimeCounter.java class RealTimeCounter (line 6) | public class RealTimeCounter { method add (line 11) | public void add(long currentTimeInMills){ method getCallsInLastSec (line 21) | public long getCallsInLastSec(long currentTimeInMills){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/RealTimeCounterUsingCircularQueue.java class RealTimeCounterUsingCircularQueue (line 6) | public class RealTimeCounterUsingCircularQueue { class Node (line 8) | class Node { method add (line 21) | public void add(long time) { method getCount (line 55) | public int getCount(int time){ method main (line 68) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/RemoveDuplicateMaintainingOrder.java class RemoveDuplicateMaintainingOrder (line 15) | public class RemoveDuplicateMaintainingOrder { method removeDuplicateLetters (line 16) | public String removeDuplicateLetters(String s) { method main (line 52) | public static void main(String args[]) { FILE: src/com/interview/stackqueue/RemoveExtraBrackets.java class RemoveExtraBrackets (line 39) | public class RemoveExtraBrackets { method remove (line 41) | public int remove(char input[]){ method removeWithoutExtraSpace (line 81) | public int removeWithoutExtraSpace(char input[]){ method printArray (line 122) | public static void printArray(char input[], int size) { method main (line 129) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/ReverseStackUsingRecursion.java class ReverseStackUsingRecursion (line 10) | public class ReverseStackUsingRecursion { method reverse (line 12) | public void reverse(Deque stack){ method pushAtBottom (line 22) | private void pushAtBottom(Deque stack,int data){ method main (line 32) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/SimplyPath.java class SimplyPath (line 21) | public class SimplyPath { method simplifyPath (line 23) | public String simplifyPath(String path) { method main (line 46) | public static void main(String args[]){ FILE: src/com/interview/stackqueue/StockSpanProblem.java class StockSpanProblem (line 19) | public class StockSpanProblem { method stockSpan (line 20) | public static int[] stockSpan(int[] prices){ method main (line 39) | public static void main(String[] args) { FILE: src/com/interview/string/AnagramOfFirstAsSubstring.java class AnagramOfFirstAsSubstring (line 16) | public class AnagramOfFirstAsSubstring { method isSubString (line 18) | public boolean isSubString(char str1[], char str2[]) { method containsAndUpdate (line 49) | private boolean containsAndUpdate(Map currentCount, method incrementCount (line 70) | private void incrementCount(Character ch, Map coun... method main (line 79) | public static void main(String args[]){ FILE: src/com/interview/string/CycleLeaderIteration.java class CycleLeaderIteration (line 3) | public class CycleLeaderIteration { method iterate (line 6) | public void iterate(char str[],int start,int end){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/string/GroupAnagramsTogether.java class GroupAnagramsTogether (line 8) | public class GroupAnagramsTogether { method groupAnagrams (line 9) | public List> groupAnagrams(String[] strs) { FILE: src/com/interview/string/InPlaceTransformationOfString.java class InPlaceTransformationOfString (line 6) | public class InPlaceTransformationOfString { method reverse (line 8) | private void reverse(char []str, int low, int high){ method swap (line 16) | private void swap(char str[],int index1,int index2){ method cycleLeaderIteration (line 22) | public void cycleLeaderIteration(char []str,int start,int end){ method inPlaceTransformationImproved (line 47) | public void inPlaceTransformationImproved(char str[]){ method get3PowerK1 (line 70) | private int get3PowerK1(int size){ method main (line 78) | public static void main(String args[]){ FILE: src/com/interview/string/LexicographicRankInPermutation.java class LexicographicRankInPermutation (line 3) | public class LexicographicRankInPermutation { method findNumberOfSmallerCharactersOnRight (line 9) | private int findNumberOfSmallerCharactersOnRight(int index,char []str){ method factorial (line 19) | private int factorial(int n){ method rank (line 27) | public int rank(char []str){ method main (line 38) | public static void main(String args[]){ FILE: src/com/interview/string/LongestPalindromeSubstring.java class LongestPalindromeSubstring (line 16) | public class LongestPalindromeSubstring { method longestPalindromeSubstringEasy (line 18) | public int longestPalindromeSubstringEasy(char arr[]) { method longestPalindromicSubstringLinear (line 60) | public int longestPalindromicSubstringLinear(char input[]) { method longestPalindromeDynamic (line 129) | public int longestPalindromeDynamic(char []str){ method main (line 161) | public static void main(String args[]) { FILE: src/com/interview/string/LongestSubstringWithKDistinctCharacters.java class LongestSubstringWithKDistinctCharacters (line 19) | public class LongestSubstringWithKDistinctCharacters { method lengthOfLongestSubstringKDistinct (line 20) | public int lengthOfLongestSubstringKDistinct(String s, int k) { method lengthOfLongestSubstringKDistinctUsingMap (line 49) | public int lengthOfLongestSubstringKDistinctUsingMap(String s, int k) { FILE: src/com/interview/string/LongestSubstringWithoutRepetingCharacter.java class LongestSubstringWithoutRepetingCharacter (line 11) | public class LongestSubstringWithoutRepetingCharacter { method lengthOfLongestSubstring (line 13) | public int lengthOfLongestSubstring(String s) { method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/string/MultiplyStrings.java class MultiplyStrings (line 6) | public class MultiplyStrings { method multiply (line 8) | public String multiply(String num1, String num2) { method multiply (line 13) | private String multiply(String num1, String num2, int start1, int end1... method simpleMultiply (line 38) | private String simpleMultiply(String num1, String num2) { method append0s (line 66) | private String append0s(String v1, int count ) { method add (line 74) | public String add(char[] num1,char[] num2){ method main (line 108) | public static void main(String args[]) { FILE: src/com/interview/string/NTMatch.java class NTMatch (line 18) | public class NTMatch { method match (line 20) | public boolean match(char str[]){ method buildKMP (line 46) | private int[] buildKMP(char str[]){ method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/string/PalindromePair.java class PalindromePair (line 20) | public class PalindromePair { method palindromePairs (line 22) | public List> palindromePairs(String[] words) { method isPalindrome (line 59) | private boolean isPalindrome(String word) { method createList (line 72) | private void createList(int i1, int i2, List> result) { method main (line 82) | public static void main(String args[]) { FILE: src/com/interview/string/PrintAnagramTogether.java class PrintAnagramTogether (line 8) | public class PrintAnagramTogether { method print (line 10) | public void print(String[] string){ method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/string/RabinKarpSearch.java class RabinKarpSearch (line 15) | public class RabinKarpSearch { method patternSearch (line 19) | public int patternSearch(char[] text, char[] pattern){ method recalculateHash (line 35) | private long recalculateHash(char[] str,int oldIndex, int newIndex,lon... method createHash (line 42) | private long createHash(char[] str, int end){ method checkEqual (line 50) | private boolean checkEqual(char str1[],int start1,int end1, char str2[... method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/string/RearrangeDuplicateCharsdDistanceAway.java class RearrangeDuplicateCharsdDistanceAway (line 13) | public class RearrangeDuplicateCharsdDistanceAway { class CharCount (line 15) | class CharCount implements Comparable{ method hashCode (line 18) | @Override method equals (line 26) | @Override method getOuterType (line 41) | private RearrangeDuplicateCharsdDistanceAway getOuterType() { method toString (line 46) | @Override method compareTo (line 50) | @Override method rearrangeExactKDistanceAway (line 61) | public boolean rearrangeExactKDistanceAway(char input[],int d){ method getAllFeasibleCharacters (line 99) | private void getAllFeasibleCharacters(char output[], int k,int pos,Set... method rearrangeAtleastkDistanceAway (line 105) | public boolean rearrangeAtleastkDistanceAway(char input[],int k){ method rearrangeAtleastkDistanceAway (line 119) | public boolean rearrangeAtleastkDistanceAway(Map ch... method main (line 145) | public static void main(String args[]){ FILE: src/com/interview/string/RemoveConsecutiveDuplicate.java class RemoveConsecutiveDuplicate (line 14) | public class RemoveConsecutiveDuplicate { method removeDuplicates (line 16) | public int removeDuplicates(char input[]){ method main (line 30) | public static void main(String args[]){ FILE: src/com/interview/string/RunLengthEncoding.java class RunLengthEncoding (line 3) | public class RunLengthEncoding { method updateCounter (line 5) | private int updateCounter(char[] result, int current, int counter){ method encoding (line 23) | public int encoding(char[] str,char[] result){ method main (line 44) | public static void main(String args[]){ FILE: src/com/interview/string/SmallestWindowContaingAllCharacters.java class SmallestWindowContaingAllCharacters (line 11) | public class SmallestWindowContaingAllCharacters { method minWindow (line 13) | public String minWindow(String s, String t) { method main (line 60) | public static void main(String args[]) { FILE: src/com/interview/string/StringEncoderDecoder.java class StringEncoderDecoder (line 16) | public class StringEncoderDecoder { method encode (line 19) | public String encode(List strs) { method toFixedLength (line 29) | private String toFixedLength(int len) { method toSize (line 39) | private int toSize(String str) { method decode (line 50) | public List decode(String s) { FILE: src/com/interview/string/SubstringSearch.java class SubstringSearch (line 12) | public class SubstringSearch { method hasSubstring (line 17) | public boolean hasSubstring(char[] text, char[] pattern){ method computeTemporaryArray (line 41) | private int[] computeTemporaryArray(char pattern[]){ method KMP (line 64) | public boolean KMP(char []text, char []pattern){ method main (line 87) | public static void main(String args[]){ FILE: src/com/interview/string/SubtringWithConcatentationOfWords.java class SubtringWithConcatentationOfWords (line 12) | public class SubtringWithConcatentationOfWords { method findSubstring (line 13) | public List findSubstring(String s, String[] words) { method set (line 58) | private void set(Map actual, String[] words) { FILE: src/com/interview/string/ValidPalindrome.java class ValidPalindrome (line 14) | public class ValidPalindrome { method isPalindrome (line 15) | public boolean isPalindrome(String s) { method isAlphaNum (line 32) | private boolean isAlphaNum(char ch) { FILE: src/com/interview/string/ValidWordAbbreviation.java class ValidWordAbbreviation (line 14) | public class ValidWordAbbreviation { method ValidWordAbbreviation (line 16) | public ValidWordAbbreviation(String[] dictionary) { method isUnique (line 37) | public boolean isUnique(String word) { FILE: src/com/interview/string/WordAbbreviationCombination.java class WordAbbreviationCombination (line 16) | public class WordAbbreviationCombination { method generateAbbreviations (line 18) | public List generateAbbreviations(String word) { method generateAbbreviationsUtil (line 24) | public void generateAbbreviationsUtil(String input, List resul... method main (line 38) | public static void main(String args[]) { FILE: src/com/interview/string/ZAlgorithm.java class ZAlgorithm (line 18) | public class ZAlgorithm { method calculateZ (line 20) | private int[] calculateZ(char input[]) { method matchPattern (line 54) | public List matchPattern(char text[], char pattern[]) { method main (line 78) | public static void main(String args[]) { FILE: src/com/interview/suffixprefix/SuffixArray.java class SuffixArray (line 9) | public class SuffixArray { class SuffixSort (line 11) | public static class SuffixSort implements Comparator{ method SuffixSort (line 15) | public SuffixSort(char str[]){ method compare (line 19) | @Override method createSuffixArray (line 37) | public Integer[] createSuffixArray(char str[]){ method stringCompare (line 48) | private int stringCompare(char str[],char subString[],int pos){ method subStringSearch (line 63) | public int subStringSearch(char str[],char subString[], Integer suffix... method main (line 81) | public static void main(String args[]){ FILE: src/com/interview/suffixprefix/SuffixTree.java class SuffixTree (line 73) | public class SuffixTree { method main (line 75) | public static void main(String args[]){ method SuffixTree (line 89) | public SuffixTree(char input[]){ method build (line 97) | public void build(){ method startPhase (line 114) | private void startPhase(int i){ method walkDown (line 219) | private void walkDown(int index){ method nextChar (line 234) | private char nextChar(int i) throws EndOfPathException{ class EndOfPathException (line 254) | private static class EndOfPathException extends Exception{ method selectNode (line 258) | private SuffixNode selectNode(){ method selectNode (line 262) | private SuffixNode selectNode(int index){ method diff (line 267) | private int diff(SuffixNode node){ method setIndexUsingDfs (line 271) | private void setIndexUsingDfs(SuffixNode root,int val, int size){ method dfsTraversal (line 290) | public void dfsTraversal(){ method dfsTraversal (line 297) | private void dfsTraversal(SuffixNode root, List result){ method validate (line 330) | private boolean validate(SuffixNode root, char[] input, int index, int... method validate (line 366) | public boolean validate(){ class SuffixNode (line 377) | class SuffixNode{ method SuffixNode (line 379) | private SuffixNode(){ method createNode (line 391) | public static SuffixNode createNode(int start, End end){ method toString (line 398) | @Override class End (line 412) | class End{ method End (line 413) | public End(int end){ class Active (line 419) | class Active{ method Active (line 420) | Active(SuffixNode node){ method toString (line 426) | @Override FILE: src/com/interview/suffixprefix/TernaryTree.java class TernaryTree (line 6) | public class TernaryTree { class Node (line 10) | class Node{ method insert (line 16) | public void insert(String data){ method search (line 21) | public boolean search(String data){ method search (line 25) | private boolean search(Node root,String data,int pos){ method insert (line 44) | private Node insert(Node root,String data,int pos){ method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/suffixprefix/Trie.java class Trie (line 15) | public class Trie { class TrieNode (line 17) | private class TrieNode { method TrieNode (line 20) | public TrieNode() { method Trie (line 27) | public Trie() { method insert (line 34) | public void insert(String word) { method insertRecursive (line 52) | public void insertRecursive(String word) { method insertRecursive (line 57) | private void insertRecursive(TrieNode current, String word, int index) { method search (line 77) | public boolean search(String word) { method searchRecursive (line 95) | public boolean searchRecursive(String word) { method searchRecursive (line 98) | private boolean searchRecursive(TrieNode current, String word, int ind... method delete (line 115) | public void delete(String word) { method delete (line 122) | private boolean delete(TrieNode current, String word, int index) { FILE: src/com/interview/tree/AVLTree.java class AVLTree (line 32) | public class AVLTree { method leftRotate (line 34) | private Node leftRotate(Node root){ method rightRotate (line 45) | private Node rightRotate(Node root){ method setHeight (line 56) | private int setHeight(Node root){ method height (line 63) | private int height(Node root){ method setSize (line 71) | private int setSize(Node root){ method insert (line 78) | public Node insert(Node root, int data){ method balance (line 111) | private int balance(Node rootLeft, Node rootRight){ method main (line 115) | public static void main(String args[]){ FILE: src/com/interview/tree/AddGreaterValueNodeToEveryNode.java class IntegerRef (line 11) | class IntegerRef{ class AddGreaterValueNodeToEveryNode (line 15) | public class AddGreaterValueNodeToEveryNode { method add (line 17) | public void add(Node root,IntegerRef ref){ method main (line 27) | public static void main(String args[]){ FILE: src/com/interview/tree/ArbitaryTreeToChildSumTree.java class ArbitaryTreeToChildSumTree (line 11) | public class ArbitaryTreeToChildSumTree { method childSumTree (line 13) | public void childSumTree(Node root){ method incrementChild (line 17) | private void incrementChild(Node root,int increment){ method toChildSumTree (line 30) | private int toChildSumTree(Node root){ method main (line 49) | public static void main(String args[]){ FILE: src/com/interview/tree/BSTOneChildPreOrderTraversal.java class BSTOneChildPreOrderTraversal (line 6) | public class BSTOneChildPreOrderTraversal { method isBST (line 8) | public boolean isBST(int input[]){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/tree/BSTSearch.java class BSTSearch (line 25) | public class BSTSearch { method search (line 27) | public Node search(Node root, int key){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/tree/BTree.java class BTree (line 7) | public class BTree { method insert (line 10) | public void insert(int data){ method search (line 27) | public boolean search(int data){ method search (line 31) | public boolean search(BTreeNode root, int data){ method insert (line 45) | private SplitResult insert(BTreeNode root,int data){ method splitNode (line 90) | private SplitResult splitNode(BTreeNode node,int data, BTreeNode nr1, ... class SplitResult (line 125) | class SplitResult{ method traverse (line 131) | public void traverse(){ method traverse (line 135) | private void traverse(BTreeNode root){ class BTreeNode (line 147) | static class BTreeNode{ method insertKey (line 153) | public void insertKey(int data,BTreeNode r1,BTreeNode r2){ method newNode (line 170) | public static BTreeNode newNode(int data){ method newNode (line 178) | public static BTreeNode newNode(){ method isFull (line 185) | public boolean isFull(){ method main (line 190) | public static void main(String args[]){ FILE: src/com/interview/tree/BinaryTree.java class NodeRef (line 12) | class NodeRef{ type Color (line 16) | enum Color{ class Node (line 21) | class Node{ method newNode (line 31) | public static Node newNode(int data){ class BinaryTree (line 44) | public class BinaryTree { method addNode (line 45) | public Node addNode(int data, Node head){ class IntegerRef (line 69) | class IntegerRef{ method height (line 73) | public int height(Node root){ method main (line 82) | public static void main(String args[]){ FILE: src/com/interview/tree/BinaryTreeFromParentRepresentation.java class BinaryTreeFromParentRepresentation (line 13) | public class BinaryTreeFromParentRepresentation { method create (line 15) | public Node create(int input[]) { method main (line 40) | public static void main(String args[]) { FILE: src/com/interview/tree/BinaryTreeMaximumPathSum.java class BinaryTreeMaximumPathSum (line 15) | public class BinaryTreeMaximumPathSum { method maxPathSum (line 18) | public int maxPathSum(Node root) { method maxPathSumUtil (line 24) | private int maxPathSumUtil(Node root) { FILE: src/com/interview/tree/BinaryTreeToCircularLinkList.java class BinaryTreeToCircularLinkList (line 9) | public class BinaryTreeToCircularLinkList { method convert (line 11) | public Node convert(Node root){ method join (line 33) | private Node join(Node r1, Node r2){ method print (line 50) | private void print(Node root){ method main (line 64) | public static void main(String args[]){ FILE: src/com/interview/tree/BinaryTreeToDoubleLinkList.java class BinaryTreeToDoubleLinkList (line 6) | public class BinaryTreeToDoubleLinkList { method toDoubleLL (line 8) | public void toDoubleLL(Node root){ method toDoubleLL (line 13) | private void toDoubleLL(Node root, NodeRef prev){ method print (line 28) | public void print(Node root){ method main (line 43) | public static void main(String args[]){ FILE: src/com/interview/tree/BinaryTreeToSortedLinkList.java class BinaryTreeToSortedLinkList (line 8) | public class BinaryTreeToSortedLinkList { method toSortedLinkList (line 10) | public Node toSortedLinkList(Node root){ method merge (line 24) | private Node merge(Node head1,Node head2){ method print (line 40) | private void print(Node root){ method main (line 47) | public static void main(String args[]){ FILE: src/com/interview/tree/BoundaryTraversal.java class BoundaryTraversal (line 11) | public class BoundaryTraversal { method traversal (line 13) | public void traversal(Node root){ method printRightSide (line 28) | private void printRightSide(Node root){ method printLeftSide (line 40) | private void printLeftSide(Node root){ method printLeaves (line 52) | private void printLeaves(Node root){ method main (line 63) | public static void main(String args[]){ FILE: src/com/interview/tree/ClosestValueBinaryTree.java class ClosestValueBinaryTree (line 7) | public class ClosestValueBinaryTree { method closestValue (line 8) | public int closestValue(Node root, double target) { method closestValueUtil (line 13) | private int closestValueUtil(Node root, double target, int result) { FILE: src/com/interview/tree/ConnectNodesAtSameLevel.java class ConnectNodesAtSameLevel (line 14) | public class ConnectNodesAtSameLevel { method connect (line 16) | public void connect(Node root) { method main (line 51) | public static void main(String args[]){ FILE: src/com/interview/tree/ConstructAllBinaryTreeFromInorderTraversal.java class ConstructAllBinaryTreeFromInorderTraversal (line 16) | public class ConstructAllBinaryTreeFromInorderTraversal { method generateTrees (line 18) | public List generateTrees(int n) { method construct (line 25) | private List construct(int start, int end) { method printAllTrees (line 48) | public void printAllTrees(List allTrees) { method main (line 59) | public static void main(String args[]) { FILE: src/com/interview/tree/ConstructBSTFromPreOrderArray.java class Index (line 3) | class Index{ class ConstructBSTFromPreOrderArray (line 12) | public class ConstructBSTFromPreOrderArray { method toBST (line 14) | public Node toBST(int preorder[]){ method toBSTIterative (line 20) | public Node toBSTIterative(int preorder[]){ method toBST (line 24) | private Node toBST(int preorder[],int min, int max,Index index){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/tree/ConstructFullTreeFromPreOrderPostOrder.java class ConstructFullTreeFromPreOrderPostOrder (line 11) | public class ConstructFullTreeFromPreOrderPostOrder { method constructTree (line 13) | public Node constructTree(int preorder[],int postorder[]){ method constructTree (line 19) | private Node constructTree(int preorder[],int postorder[],int low,int ... method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/tree/ConstructTreeFromInOrderPreOrder.java class ConstructTreeFromInOrderPreOrder (line 14) | public class ConstructTreeFromInOrderPreOrder { method createTree (line 17) | public Node createTree(int inorder[],int preorder[]){ method createTree (line 23) | private Node createTree(int inorder[],int preorder[], int start, int e... FILE: src/com/interview/tree/ConstructTreeFromLevelOrderInOrder.java class ConstructTreeFromLevelOrderInOrder (line 13) | public class ConstructTreeFromLevelOrderInOrder { method constructTree (line 15) | public Node constructTree(int inOrder[], int levelOrder[]){ method extractArray (line 19) | private int[] extractArray(int inOrder[], int levelOrder[],int low, in... method constructTree (line 31) | private Node constructTree(int inOrder[], int levelOrder[], int low, i... method search (line 45) | private int search(int input[],int key, int low, int high){ method main (line 59) | public static void main(String args[]){ FILE: src/com/interview/tree/ConstructTreeFromPreOrderTraversalWith0or2Child.java class PreIndex (line 9) | class PreIndex{ class ConstructTreeFromPreOrderTraversalWith0or2Child (line 12) | public class ConstructTreeFromPreOrderTraversalWith0or2Child { method createTree (line 14) | public Node createTree(int pre[],char val[]){ method createTree (line 20) | private Node createTree(int pre[],char val[], PreIndex ind){ method main (line 36) | public static void main(String args[]){ FILE: src/com/interview/tree/ContructTreeFromInOrderTraversalRootGreaterThanChild.java class ContructTreeFromInOrderTraversalRootGreaterThanChild (line 10) | public class ContructTreeFromInOrderTraversalRootGreaterThanChild { method createTree (line 12) | public Node createTree(int inorder[]){ method createTree (line 15) | private Node createTree(int inorder[],int low,int high) method main (line 33) | public static void main(String args[]){ FILE: src/com/interview/tree/ContructTreeFromInorderPostOrder.java class ContructTreeFromInorderPostOrder (line 8) | public class ContructTreeFromInorderPostOrder { method buildTree (line 9) | public Node buildTree(int[] inorder, int[] postorder) { method buildTree (line 13) | public Node buildTree(int[] inorder, int[] postorder, int start, int e... FILE: src/com/interview/tree/CountNodesCompleteTree.java class CountNodesCompleteTree (line 14) | public class CountNodesCompleteTree { method countNodes (line 16) | public int countNodes(Node root) { method leftHeight (line 35) | int leftHeight(Node root) { method rightHeight (line 43) | int rightHeight(Node root) { FILE: src/com/interview/tree/CountNumberOfSmallerElementOnRight.java class CountNumberOfSmallerElementOnRight (line 12) | public class CountNumberOfSmallerElementOnRight { method leftRotate (line 13) | private Node leftRotate(Node root){ method rightRotate (line 24) | private Node rightRotate(Node root){ method setHeight (line 35) | private int setHeight(Node root){ method height (line 42) | private int height(Node root){ method setSize (line 50) | private int setSize(Node root){ method insert (line 57) | private Node insert(Node root, int data,int count[],int pos,int val){ method count (line 94) | public int[] count(int input[]){ method main (line 103) | public static void main(String args[]){ FILE: src/com/interview/tree/CountPathSum.java class CountPathSum (line 9) | public class CountPathSum { method pathSum (line 10) | public int pathSum(Node root, int sum) { method countPathSum (line 16) | private int countPathSum(Node root, int sum, Map map... FILE: src/com/interview/tree/CountUnivalueTree.java class CountUnivalueTree (line 12) | public class CountUnivalueTree { method countUnivalSubtrees (line 14) | public int countUnivalSubtrees(Node root) { method countUnivalSubtreesUtil (line 19) | private int countUnivalSubtreesUtil(Node root, int val) { FILE: src/com/interview/tree/CousinNodes.java class CousinNodes (line 13) | public class CousinNodes { method areCousins1 (line 19) | public boolean areCousins1(Node root, int data1, int data2) { method areCousins (line 68) | public boolean areCousins(Node root, int a, int b) { method checkSameParent (line 107) | private boolean checkSameParent(Node root, int a, int b) { method main (line 117) | public static void main(String args[]) { FILE: src/com/interview/tree/DegenerateBinaryTreeToSortedLL.java class DegenerateBinaryTreeToSortedLL (line 30) | public class DegenerateBinaryTreeToSortedLL { method degenerate (line 32) | public Node degenerate(Node root){ method merge (line 47) | private Node merge(Node root1, Node root2){ method printList (line 64) | private void printList(Node root){ method main (line 71) | public static void main(String args[]){ FILE: src/com/interview/tree/DiameterOfTree.java class Height (line 3) | class Height{ class DiameterOfTree (line 13) | public class DiameterOfTree { method diameter (line 15) | public int diameter(Node root){ method diameter (line 20) | private int diameter(Node root, Height height){ method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/tree/FenwickTree.java class FenwickTree (line 22) | public class FenwickTree { method updateBinaryIndexedTree (line 28) | public void updateBinaryIndexedTree(int binaryIndexedTree[], int val, ... method getSum (line 39) | public int getSum(int binaryIndexedTree[], int index){ method createTree (line 52) | public int[] createTree(int input[]){ method getParent (line 66) | private int getParent(int index){ method getNext (line 76) | private int getNext(int index){ method main (line 80) | public static void main(String args[]){ FILE: src/com/interview/tree/FlattenLinkListToBinaryTreePreorder.java class FlattenLinkListToBinaryTreePreorder (line 15) | public class FlattenLinkListToBinaryTreePreorder { method flatten (line 16) | public void flatten(Node root) { method flatten1 (line 40) | public void flatten1(Node root) { FILE: src/com/interview/tree/HeightBalanced.java class HeightBalanced (line 14) | public class HeightBalanced { method isBalanced (line 15) | public boolean isBalanced(Node root) { method isBalancedUtil (line 19) | private int isBalancedUtil(Node root) { FILE: src/com/interview/tree/HuffmanEncoding.java class HuffmanNode (line 12) | class HuffmanNode{ class HuffmanNodeComparator (line 19) | class HuffmanNodeComparator implements Comparator{ method compare (line 21) | @Override class HuffmanEncoding (line 32) | public class HuffmanEncoding { method huffman (line 34) | public Map huffman(char[] input, int freq[]){ method createCode (line 61) | public void createCode(HuffmanNode node,Map map,Stri... method main (line 79) | public static void main(String args[]){ FILE: src/com/interview/tree/IdenticalTrees.java class IdenticalTrees (line 13) | public class IdenticalTrees { class BigSmall (line 15) | private class BigSmall{ method sameBST (line 20) | public boolean sameBST(int tree1[], int tree2[]){ method sameBST (line 24) | private boolean sameBST(int tree1[],int tree2[],int min,int max,int in... method nextBigSmall (line 53) | private BigSmall nextBigSmall(int[] tree,int index,int min,int max){ method sameBST1 (line 81) | public boolean sameBST1(int arr1[], int arr2[]){ method sameBST1 (line 98) | private boolean sameBST1(List arr1, List arr2){ method compare (line 145) | private boolean compare(List l1, List l2){ method main (line 158) | public static void main(String args[]){ FILE: src/com/interview/tree/InorderSuccessor.java class InorderSuccessor (line 14) | public class InorderSuccessor { method inorderSuccessor (line 15) | public Node inorderSuccessor(Node root, Node p) { method succ (line 27) | private Node succ(Node root, int data) { FILE: src/com/interview/tree/IntervalTree.java class InternalNode (line 13) | class InternalNode { method toString (line 20) | @Override class IntervalTree (line 30) | public class IntervalTree { method insert (line 32) | public InternalNode insert(InternalNode root, int low, int high) { method isOverlap (line 51) | public InternalNode isOverlap(InternalNode root, int low, int high) { method main (line 67) | public static void main(String args[]) { FILE: src/com/interview/tree/IsBST.java class IsBST (line 27) | public class IsBST { method isBST (line 29) | public boolean isBST(Node root){ method isBST (line 33) | private boolean isBST(Node root, int min, int max){ method isBSTIterative (line 44) | public boolean isBSTIterative(Node root) { method main (line 73) | public static void main(String args[]){ FILE: src/com/interview/tree/IsCompleteBinaryTree.java class IsCompleteBinaryTree (line 13) | public class IsCompleteBinaryTree { method isComplete (line 15) | public boolean isComplete(Node root){ method main (line 42) | public static void main(String args[]){ FILE: src/com/interview/tree/IsPreOrderArrayBST.java class IsPreOrderArrayBST (line 19) | public class IsPreOrderArrayBST { method verifyPreorder (line 21) | public boolean verifyPreorder(int pre[]) { method verifyPreorderConstantSpace (line 37) | public boolean verifyPreorderConstantSpace(int[] preorder) { method binarySearch (line 53) | int binarySearch(int[] preorder, int start, int end, int val) { method main (line 69) | public static void main(String args[]) { FILE: src/com/interview/tree/KClosestValueInBinaryTree.java class KClosestValueInBinaryTree (line 17) | public class KClosestValueInBinaryTree { method closestKValues (line 19) | public List closestKValues(Node root, double target, int k) { method predecessor (line 73) | private Node predecessor(Stack stack, Node current) { method successor (line 97) | private Node successor(Stack stack, Node current) { FILE: src/com/interview/tree/LargestBSTInBinaryTree.java class LargestBSTInBinaryTree (line 24) | public class LargestBSTInBinaryTree { method largestBST (line 26) | public int largestBST(Node root){ method largest (line 31) | private MinMax largest(Node root){ method main (line 71) | public static void main(String args[]){ class MinMax (line 88) | class MinMax{ method MinMax (line 94) | MinMax(){ FILE: src/com/interview/tree/LargestIndependentSetInTree.java class LargestIndependentSetInTree (line 6) | public class LargestIndependentSetInTree { method largestSet (line 8) | public int largestSet(Node root){ method main (line 34) | public static void main(String args[]){ FILE: src/com/interview/tree/LeavesOfBinaryTree.java class LeavesOfBinaryTree (line 17) | public class LeavesOfBinaryTree { method findLeaves (line 18) | public List> findLeaves(Node root) { method stripLeaves (line 32) | Node stripLeaves(Node root, List leaves) { FILE: src/com/interview/tree/LevelOrderTraversal.java class LevelOrderTraversal (line 18) | public class LevelOrderTraversal { method levelOrder (line 20) | public void levelOrder(Node root){ method main (line 40) | public static void main(String args[]){ FILE: src/com/interview/tree/LevelOrderTraversalInReverse.java class LevelOrderTraversalInReverse (line 29) | public class LevelOrderTraversalInReverse { method reverseLevelOrderTraversal (line 31) | public void reverseLevelOrderTraversal(Node root){ method main (line 54) | public static void main(String args[]){ FILE: src/com/interview/tree/LongestConsecutiveSequence.java class LongestConsecutiveSequence (line 6) | public class LongestConsecutiveSequence { method longestConsecutive (line 8) | public int longestConsecutive(Node root) { method longestConsecutiveUtil (line 17) | public void longestConsecutiveUtil(Node root, int prevData, int curren... FILE: src/com/interview/tree/LowestCommonAncestorInBinaryTree.java class LowestCommonAncestorInBinaryTree (line 12) | public class LowestCommonAncestorInBinaryTree { method lca (line 14) | public Node lca(Node root, Node n1, Node n2){ FILE: src/com/interview/tree/LowestCommonAncestoryBinarySearchTree.java class LowestCommonAncestoryBinarySearchTree (line 14) | public class LowestCommonAncestoryBinarySearchTree { method lowestCommonAncestor (line 16) | public Node lowestCommonAncestor(Node root, int p, int q) { FILE: src/com/interview/tree/MorrisTraversal.java class MorrisTraversal (line 12) | public class MorrisTraversal { method inorder (line 14) | public void inorder(Node root) { method preorder (line 42) | public void preorder(Node root) { method main (line 66) | public static void main(String args[]) { FILE: src/com/interview/tree/NextInorderSuccessorIterator.java class NextInorderSuccessorIterator (line 11) | public class NextInorderSuccessorIterator { method NextInorderSuccessorIterator (line 16) | NextInorderSuccessorIterator(Node root){ method next (line 20) | public int next(){ method hasNext (line 32) | public boolean hasNext(){ method main (line 39) | public static void main(String args[]){ FILE: src/com/interview/tree/NextInorderSuccessorOfTwoTree.java class NextInorderSuccessorOfTwoTree (line 11) | public class NextInorderSuccessorOfTwoTree { method NextInorderSuccessorOfTwoTree (line 19) | NextInorderSuccessorOfTwoTree(Node root1, Node root2) { method hasNext (line 24) | public boolean hasNext() { method next (line 32) | public Node next() { method main (line 60) | public static void main(String args[]){ FILE: src/com/interview/tree/NodesAtDistanceK.java class NodesAtDistanceK (line 11) | public class NodesAtDistanceK { method findInChild (line 13) | private void findInChild(Node root, int k){ method printNodes (line 24) | public int printNodes(Node root,int dest, int k){ method main (line 56) | public static void main(String args[]){ FILE: src/com/interview/tree/NodesWithNoSibling.java class NodesWithNoSibling (line 13) | public class NodesWithNoSibling { method printNodes (line 15) | public void printNodes(Node root){ method main (line 31) | public static void main(String args[]){ FILE: src/com/interview/tree/PathSum.java class PathSum (line 17) | public class PathSum { method pathSum (line 18) | public List> pathSum(Node root, int sum) { method pathSumUtil (line 25) | private void pathSumUtil(Node root, int sum, List> resul... method hasPathSum (line 43) | public boolean hasPathSum(Node root, int sum) { FILE: src/com/interview/tree/PopulateInOrderSuccessor.java class PopulateInOrderSuccessor (line 6) | public class PopulateInOrderSuccessor { method populate (line 8) | private void populate(Node root, NodeRef nodeRef){ method populate (line 18) | public void populate(Node root){ method print (line 23) | public void print(Node root){ method main (line 31) | public static void main(String args[]){ FILE: src/com/interview/tree/PrintPostOrderFromPreOrderInOrder.java class PrintPostOrderFromPreOrderInOrder (line 18) | public class PrintPostOrderFromPreOrderInOrder { method postOrder (line 20) | public int[] postOrder(int[] preorder, int[] inorder) { method postOrder (line 27) | private void postOrder(int[] preorder, int[] inorder, int post[], int ... method main (line 42) | public static void main(String args[]) { FILE: src/com/interview/tree/PrintTwoBSTInSortedForm.java class PrintTwoBSTInSortedForm (line 16) | public class PrintTwoBSTInSortedForm { method print (line 18) | public void print(Node root1, Node root2){ method main (line 68) | public static void main(String args[]){ FILE: src/com/interview/tree/RedBlackTree.java class RedBlackTree (line 24) | public class RedBlackTree { type Color (line 26) | public enum Color { class Node (line 31) | public static class Node { method createBlackNode (line 40) | private static Node createBlackNode(int data) { method createNullLeafNode (line 49) | private static Node createNullLeafNode(Node parent) { method createRedNode (line 57) | private static Node createRedNode(Node parent, int data) { method insert (line 70) | public Node insert(Node root, int data) { method delete (line 77) | public Node delete(Node root, int data) { method printRedBlackTree (line 90) | public void printRedBlackTree(Node root) { method validateRedBlackTree (line 97) | public boolean validateRedBlackTree(Node root) { method rightRotate (line 113) | private void rightRotate(Node root, boolean changeColor) { method leftRotate (line 136) | private void leftRotate(Node root, boolean changeColor) { method findSiblingNode (line 159) | private Optional findSiblingNode(Node root) { method isLeftChild (line 168) | private boolean isLeftChild(Node root) { method insert (line 177) | private Node insert(Node parent, Node root, int data) { method delete (line 292) | private void delete(Node root, int data, AtomicReference rootRef... method findSmallest (line 318) | private Node findSmallest(Node root) { method deleteOneChild (line 330) | private void deleteOneChild(Node nodeToBeDelete, AtomicReference... method deleteCase1 (line 351) | private void deleteCase1(Node doubleBlackNode, AtomicReference r... method deleteCase2 (line 364) | private void deleteCase2(Node doubleBlackNode, AtomicReference r... method deleteCase3 (line 384) | private void deleteCase3(Node doubleBlackNode, AtomicReference r... method deleteCase4 (line 402) | private void deleteCase4(Node doubleBlackNode, AtomicReference r... method deleteCase5 (line 419) | private void deleteCase5(Node doubleBlackNode, AtomicReference r... method deleteCase6 (line 437) | private void deleteCase6(Node doubleBlackNode, AtomicReference r... method replaceNode (line 453) | private void replaceNode(Node root, Node child, AtomicReference ... method printRedBlackTree (line 467) | private void printRedBlackTree(Node root, int space) { method noRedRedParentChild (line 479) | private boolean noRedRedParentChild(Node root, Color parentColor) { method checkBlackNodesCount (line 490) | private boolean checkBlackNodesCount(Node root, AtomicInteger blackCou... method main (line 507) | public static void main(String args[]) { FILE: src/com/interview/tree/RootToLeafToSum.java class RootToLeafToSum (line 27) | public class RootToLeafToSum { method printPath (line 29) | public boolean printPath(Node root, int sum, List path){ method main (line 49) | public static void main(String args[]){ FILE: src/com/interview/tree/SameTree.java class SameTree (line 17) | public class SameTree { method sameTree (line 19) | public boolean sameTree(Node root1, Node root2){ method main (line 32) | public static void main(String args[]){ FILE: src/com/interview/tree/SegmentTree.java class SegmentTree (line 25) | public class SegmentTree { method createTree (line 27) | public int[] createTree(int input[], Operation operation){ method constructTree (line 34) | private void constructTree(int segmentTree[], int input[], int low, in... method rangeQuery (line 45) | public int rangeQuery(int []segmentTree,int qlow,int qhigh,int len, Op... method rangeQuery (line 49) | private int rangeQuery(int segmentTree[],int low,int high,int qlow,int... method updateValueForSumOperation (line 61) | public void updateValueForSumOperation(int input[],int segmentTree[],i... method updateVal (line 67) | private void updateVal(int segmentTree[],int low,int high,int diff,int... method main (line 80) | public static void main(String args[]){ type Operation (line 107) | interface Operation{ method perform (line 108) | int perform(int a, int b); class SumOperation (line 111) | class SumOperation implements Operation{ method perform (line 113) | @Override class MinOperation (line 119) | class MinOperation implements Operation{ method perform (line 120) | @Override FILE: src/com/interview/tree/SegmentTreeMinimumRangeQuery.java class SegmentTreeMinimumRangeQuery (line 32) | public class SegmentTreeMinimumRangeQuery { method createSegmentTree (line 37) | public int[] createSegmentTree(int input[]){ method updateSegmentTree (line 56) | public void updateSegmentTree(int input[], int segmentTree[], int inde... method updateSegmentTreeRange (line 64) | public void updateSegmentTreeRange(int input[], int segmentTree[], int... method rangeMinimumQuery (line 74) | public int rangeMinimumQuery(int []segmentTree,int qlow,int qhigh,int ... method updateSegmentTreeRangeLazy (line 81) | public void updateSegmentTreeRangeLazy(int input[], int segmentTree[],... method rangeMinimumQueryLazy (line 88) | public int rangeMinimumQueryLazy(int segmentTree[], int lazy[], int ql... method constructMinSegmentTree (line 92) | private void constructMinSegmentTree(int segmentTree[], int input[], i... method updateSegmentTree (line 103) | private void updateSegmentTree(int segmentTree[], int index, int delta... method updateSegmentTreeRange (line 125) | private void updateSegmentTreeRange(int segmentTree[], int startRange,... method rangeMinimumQuery (line 141) | private int rangeMinimumQuery(int segmentTree[],int low,int high,int q... method updateSegmentTreeRangeLazy (line 153) | private void updateSegmentTreeRangeLazy(int segmentTree[], method rangeMinimumQueryLazy (line 195) | private int rangeMinimumQueryLazy(int segmentTree[], int lazy[], int q... method main (line 232) | public static void main(String args[]){ FILE: src/com/interview/tree/SerializeDeserializeBinaryTree.java class SerializeDeserializeBinaryTree (line 19) | public class SerializeDeserializeBinaryTree { method serialize (line 26) | public String serialize(Node root) { method serializeUtil (line 32) | private void serializeUtil(Node root, StringBuffer buff) { method deserialize (line 55) | public Node deserialize(String data) { method deserializeUtil (line 61) | private Node deserializeUtil(String input[]) { method serializeLevelOrder (line 87) | public String serializeLevelOrder(Node root) { method deserializeLevelOrder (line 118) | public Node deserializeLevelOrder(String data) { method main (line 145) | public static void main(String args[]) { FILE: src/com/interview/tree/SinkNegativeToBottom.java class SinkNegativeToBottom (line 6) | public class SinkNegativeToBottom { method sinkZero (line 8) | public void sinkZero(Node root) { method pushDown (line 21) | private void pushDown(Node root) { method main (line 46) | public static void main(String args[]){ FILE: src/com/interview/tree/SizeOfBinaryTree.java class SizeOfBinaryTree (line 20) | public class SizeOfBinaryTree { method size (line 22) | public int size(Node root){ method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/tree/SortedArrayToBST.java class SortedArrayToBST (line 14) | public class SortedArrayToBST { method sortedArrayToBST (line 15) | public Node sortedArrayToBST(int[] nums) { method toBST (line 19) | private Node toBST(int[] nums, int low, int high) { FILE: src/com/interview/tree/SortedOrderPrintCompleteTreeArray.java class SortedOrderPrintCompleteTreeArray (line 10) | public class SortedOrderPrintCompleteTreeArray { method print (line 12) | private void print(int arr[],int current){ method print (line 21) | public void print(int arr[]){ method main (line 25) | public static void main(String args[]){ FILE: src/com/interview/tree/SuccinctTree.java class SuccinctTree (line 16) | public class SuccinctTree { class Result (line 18) | public static class Result { method encode (line 23) | public Result encode(Node root) { method encode (line 29) | private void encode(Node root, Result r) { method decode (line 41) | public Node decode(Result r) { method decode (line 47) | private Node decode(Result r, AtomicInteger x, AtomicInteger y) { method main (line 61) | public static void main(String args[]) { FILE: src/com/interview/tree/SumTree.java class Count (line 4) | class Count{ class SumTree (line 13) | public class SumTree { method isSumTree (line 15) | public boolean isSumTree(Node root){ method isSumTree (line 20) | private boolean isSumTree(Node root,Count count){ method main (line 36) | public static void main(String args[]){ FILE: src/com/interview/tree/TreeIsomorphism.java class TreeIsomorphism (line 10) | public class TreeIsomorphism { method areIsomorphicTrees (line 12) | public boolean areIsomorphicTrees(Node root1, Node root2) { method main (line 29) | public static void main(String args[]){ FILE: src/com/interview/tree/TreeTraversalInSpiralOrder.java class TreeTraversalInSpiralOrder (line 38) | public class TreeTraversalInSpiralOrder { method spiralWithTwoStack (line 43) | public void spiralWithTwoStack(Node root) { method spiralWithOneDeque (line 78) | public void spiralWithOneDeque(Node root) { method spiralWithOneDequeDelimiter (line 122) | public void spiralWithOneDequeDelimiter(Node root) method main (line 158) | public static void main(String args[]) { FILE: src/com/interview/tree/TreeTraversalLevelByLevel.java class TreeTraversalLevelByLevel (line 37) | public class TreeTraversalLevelByLevel { method levelByLevelTwoQueue (line 42) | public void levelByLevelTwoQueue(Node root) { method levelByLevelOneQueueUsingDelimiter (line 78) | public void levelByLevelOneQueueUsingDelimiter(Node root) { method levelByLevelOneQueueUsingCount (line 107) | public void levelByLevelOneQueueUsingCount(Node root) { method main (line 135) | public static void main(String args[]) { FILE: src/com/interview/tree/TreeTraversals.java class TreeTraversals (line 16) | public class TreeTraversals { method inOrder (line 18) | public void inOrder(Node root){ method preOrder (line 27) | public void preOrder(Node root){ method postOrder (line 36) | public void postOrder(Node root){ method inorderItr (line 45) | public void inorderItr(Node root){ method preOrderItr (line 64) | public void preOrderItr(Node root){ method postOrderItr (line 79) | public void postOrderItr(Node root){ method postOrderItrOneStack (line 98) | public void postOrderItrOneStack(Node root){ method main (line 121) | public static void main(String args[]){ FILE: src/com/interview/tree/UpsidedownBinaryTree.java class UpsidedownBinaryTree (line 10) | public class UpsidedownBinaryTree { method upsideDownBinaryTree (line 11) | public Node upsideDownBinaryTree(Node root) { method upsideDownBinaryTree (line 18) | public Node upsideDownBinaryTree(Node root, Node parent, Node rightChi... FILE: src/com/interview/tree/VertexCoverBinaryTreeDP.java class VertexCoverBinaryTreeDP (line 13) | public class VertexCoverBinaryTreeDP { method cover (line 15) | public int cover(Node root){ method main (line 41) | public static void main(String args[]){ FILE: src/com/interview/tree/VerticalOrder.java class VerticalOrder (line 11) | public class VerticalOrder { method verticalOrder (line 12) | public List> verticalOrder(Node root) { FILE: src/com/interview/tree/VerticalTreePrinting.java class VerticalTreePrinting (line 11) | public class VerticalTreePrinting { method printVertical (line 13) | public void printVertical(Node root){ method printLevel (line 19) | private void printLevel(Map> map){ method populateMap (line 29) | private void populateMap(Node root, Map> map,int le... method main (line 45) | public static void main(String args[]){ FILE: test/com/interview/TestUtil.java class TestUtil (line 7) | public class TestUtil { method compareList (line 8) | public void compareList(List expected, List actual) { method compareListOfList (line 15) | public void compareListOfList(List> expected, List> ac... FILE: test/com/interview/array/AdditiveNumberTest.java class AdditiveNumberTest (line 5) | public class AdditiveNumberTest { method main (line 6) | public static void main(String args[]) { FILE: test/com/interview/array/ArrayAdditionTest.java class ArrayAdditionTest (line 6) | public class ArrayAdditionTest { method testAddSimple (line 8) | @Test FILE: test/com/interview/array/MaximumMinimumArrangementTest.java class MaximumMinimumArrangementTest (line 6) | public class MaximumMinimumArrangementTest { method differentCases (line 7) | @Test FILE: test/com/interview/array/MeetingRoomsTest.java class MeetingRoomsTest (line 8) | public class MeetingRoomsTest { method testDifferentCases (line 10) | @Test FILE: test/com/interview/array/MultiplyAllFieldsExceptOwnPositionTest.java class MultiplyAllFieldsExceptOwnPositionTest (line 6) | public class MultiplyAllFieldsExceptOwnPositionTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/array/NumberOfTriangledInUnsortedArrayTest.java class NumberOfTriangledInUnsortedArrayTest (line 6) | public class NumberOfTriangledInUnsortedArrayTest { method testSimpleCase (line 8) | @Test FILE: test/com/interview/array/ThreeSumSmallerThanTargetTest.java class ThreeSumSmallerThanTargetTest (line 6) | public class ThreeSumSmallerThanTargetTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/bits/CountingBitsTillNumTest.java class CountingBitsTillNumTest (line 9) | public class CountingBitsTillNumTest { method testDifferentCases (line 11) | @Test FILE: test/com/interview/bits/MaxProductWordLengthTest.java class MaxProductWordLengthTest (line 6) | public class MaxProductWordLengthTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/dynamic/DecodeWaysTest.java class DecodeWaysTest (line 5) | public class DecodeWaysTest { method testDifferentCases (line 6) | @Test FILE: test/com/interview/dynamic/PalindromePartitionTest.java class PalindromePartitionTest (line 9) | public class PalindromePartitionTest { method testAllPartitions (line 11) | @Test method palindromePartitionMinCuts (line 33) | @Test FILE: test/com/interview/graph/CourseScheduleTest.java class CourseScheduleTest (line 6) | public class CourseScheduleTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/graph/TravelingSalesmanHeldKarpTest.java class TravelingSalesmanHeldKarpTest (line 6) | public class TravelingSalesmanHeldKarpTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/graph/WallsAndGatesTest.java class WallsAndGatesTest (line 6) | public class WallsAndGatesTest { method testDifferentScenarios (line 8) | @Test FILE: test/com/interview/linklist/DeleteDuplicateNodesTest.java class DeleteDuplicateNodesTest (line 5) | public class DeleteDuplicateNodesTest { method testDifferentCases (line 7) | @Test FILE: test/com/interview/misc/IntegerListParserTest.java class IntegerListParserTest (line 6) | public class IntegerListParserTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/multiarray/Mutable2DSumRangeQueryTest.java class Mutable2DSumRangeQueryTest (line 6) | public class Mutable2DSumRangeQueryTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/number/AllStrobogrammaticNumberTest.java class AllStrobogrammaticNumberTest (line 6) | public class AllStrobogrammaticNumberTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/number/BasicCalculatorTest.java class BasicCalculatorTest (line 6) | public class BasicCalculatorTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/recursion/RestoreIPAddressesTest.java class RestoreIPAddressesTest (line 9) | public class RestoreIPAddressesTest { method testDifferenceCases (line 11) | @Test FILE: test/com/interview/string/LongestSubstringWithKDistinctCharactersTest.java class LongestSubstringWithKDistinctCharactersTest (line 6) | public class LongestSubstringWithKDistinctCharactersTest { method testDifferenceCases (line 8) | @Test FILE: test/com/interview/string/PalindromePairTest.java class PalindromePairTest (line 9) | public class PalindromePairTest { method testDifferentCases (line 11) | @Test method createList (line 32) | private List> createList(int... index) { FILE: test/com/interview/string/StringEncoderDecoderTest.java class StringEncoderDecoderTest (line 9) | public class StringEncoderDecoderTest { method testDifferentCases (line 11) | @Test FILE: test/com/interview/string/ValidPalindromeTest.java class ValidPalindromeTest (line 6) | public class ValidPalindromeTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/string/ValidWordAbbreviationTest.java class ValidWordAbbreviationTest (line 6) | public class ValidWordAbbreviationTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/suffixprefix/TrieTest.java class TrieTest (line 6) | public class TrieTest { method testDifferentCases (line 8) | @Test FILE: test/com/interview/tree/KClosestValueInBinaryTreeTest.java class KClosestValueInBinaryTreeTest (line 9) | public class KClosestValueInBinaryTreeTest { method testDifferentCases (line 11) | @Test FILE: test/com/interview/tree/VerticalOrderTest.java class VerticalOrderTest (line 10) | public class VerticalOrderTest { method testDifferentCases (line 12) | @Test