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 doing an asymptotic and experimental analysis. The asymptotic analysis went well and I concluded that my algorithm is O(nlogn). The problem is the experimental analysis.
Tag: algorithm
Hacker Rank Frequency Queries [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question 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
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 employees. I would like to do this by measuring the following parameters as percentages of the amount of time they spend working: I have a
How treemap handles case of putting key on same index?
I tried out following code: public static void main (String[] args) throws java.lang.Exception { // sorting based on number of dots Map map =new TreeMap((o1, o2) -&…
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
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 my code and it is working as expected, but it suddenly crashes in a non recursive method. I have been reading about this issue on the internet and
Create an algorithm that arranges them in order to form the largest possible integer
I am struggling with this coding problem in Java. It has to be solved using an algorithm. It is supposed to give me the largest possible inter that can be formed with the numbers in the array: {10, 7, 76, 415}. I tried to solve it using selection sort. So far I have is this code below but it’s giving
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. The insert method uses the first field. The first field passes its data to the current field. After the method exits with the current field, no changes are