Category

Technology

Dual Knapsack – Java

By | Technology | No Comments

I came across the following question while I was studying: You are given a set of integers and you are also allowed to apply sign change operation on all elements. Write an efficient algorithm to find minimum Sum. The minimum Sum should be greater than equal to zero. e.g. if Set is { 2, 1, 3, 4, 2 } Minimum…

Read More

Speeding up SQLRPGLE by using indexes.

By | Technology | No Comments

I have always been partial to SQLRPGLE rather than writing around those chain statements in the RPGLE. More often than not, we are worried about the correctness and not about the efficiency of the program. Even I was not be excused on this accusation, well we can argue how can you increase the performance if we don’t know how it works right? So,…

Read More

Angry Professor – Python Problem

By | Technology | 2 Comments

A Discrete Mathematics professor has a class of N students. Frustrated with their lack of discipline, he decides to cancel class if fewer than K students are present when class starts. Given the arrival time of each student, determine if the class is canceled. Input Format The first line of input contains T, the number of test cases. Each test…

Read More