Give a list of bomb, each mine has 3 numbers, x, y coordinates and explosion range. Find the initial mine that can eventually detonate the most mines

Give a list of mines, each mine contains 3 numbers, x, y coordinates and explosion range . Find the initial mine that can eventually detonate the most mines and maximum number of mine it denotes. the …

How do I write a Drake sort algorithm for sorting an array in Java? [closed]

I’m writing a Drake Sort Algorithm in java that will sort a collection of elements. The algorithm is supposed to work like this: An array for example: { -2, 4, 1, 4 } Get the max value of the array …

Experimental Analysis of an Algorithm – How to prove that the graph is O(nlogn)?

This question is probably stupid, but I’ve been trying to figure this out for hours and I still couldn’t find anything about it. Probably I’m just too lost. So basically, I’m analysing an algorithm by …

Hacker Rank Frequency Queries [closed]

I am doing the Hacker Rank Frequency Queries question and all my test cases pass but one for Time limit exceeded. What can I do to make my program more efficient. static List freqQuery(…

Algorithm to show how far away a value is from another

Disclaimer: This is a very very difficult question about mathematics and algorithms (in my opinion) – so respect to anyone who makes this. I admire you. I would like to evaluate the performance of my …

Linked List – remove duplicates algorithm in C#/Java

I am studying Data Structures and Algorithms in C#/Java. After encountering a solution to the problem of Linked List duplicate removal, I have been struggling to understand it. The solution is the one …

Doubly Linked List QuickSort Implementation Problem

I’ve implemented a classic Doubly Linked List: class Node { protected T data; protected Node next, prev; } class DoublyLinkedList> { …

Number of substrings with unique letters

I have a string, now want to count the minimum number of substrings such that the letters in the substring should occur only once. Example: Input : cycle Output : 2 explanation: Possible substrings …

StackOverflowError on recursive algorithm

I’m trying to code a recursive algorithm in order to generate a valid board(unique solution) for a game called kakuro. When executing the program I keep getting a StackOverflowError. I tried debugging …

Why does the class fields update their data after the method works

Help me please. Let’s say I have a Link class for linked lists. And there is the SortedList class where there are methods for working with data created by the first class. public class Link { public …