Given N keys and values , and q queries for each query you have given key you have to find key smaller than given key with maximun value . for example:- keys — 2 3 1 6 4 values — 5 1 6 2 8 given key 5 must produce output 8 i.e (4,8)
can any one explain how persistent tries work and provide implementation of it ? it's hard to find good explanation of persistent tries
i recently solving this problem the problem is quite interesting can somebody suggest any method to solve this question if range of k increase from 200 to n .
i am trying to solve the problem https://www.hackerrank.com/challenges/tree-pruning/problem . the main point here is how to choice which subtree we have to delete and how dfs order to visit the node can help us ?
i want to know how to optimize classic 0/1 knapsack to 0/k knapsack . the problem link is https://open.kattis.com/problems/thief
i am trying to do these question with binary search but it pass only few cases . my soln is http://codeforces.com/contest/604/submission/44016513
how to do this problem with segment tree data structure. https://www.codechef.com/SEPT17/problems/SEACO