Problem My task is to use the following pseudocode and improve it (make it run faster). Also I have to […]
Tag: complexity
Finding whether there exists a pair of numbers in a set having a given product
Problem Devise an algorithm that will operate on a number x and a set of n distinct numbers such that […]
Finding a max element in an array in Java
Problem Created the following method: public static int max(int[] array) { int max = Integer.MIN_VALUE; for (int value : array) […]
Generate unique string permutations recursively
Problem Objective Write a recursive method for generating all permutations of an input string. Return them as a set. See: […]
Optimizing methods with multiple if checks on getter values
Problem I have a method where I fetch user input, check if certain values exist, and based on that build […]
Calculating the mean differences of subarrays
Problem I’m trying to devise a way to calculate the mean differences (the absolute average differences between any two values […]
Find the longest subarray with sum less than K
Problem The problem consist of finding the longest contiguous subarray with a sum less than a given integer K. The […]
Simple 1-dimensional labyrinth
Problem I am training a colleague who is familiar with Python but has a limited knowledge of C# and complexity. […]
Min Heap Priority Queue
Problem This was a part of one an assignment I found online and tried to solve it myself. The objective […]
Big O notation for quicksort implementation [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. Questions containing broken code or asking for advice […]