algorithm tag

168 questions


1 answers
72 views
0
a method of shaping a passage so that the width of a plurality of passages drawn at random is the same time

I'm trying to create a random map of the dungeon.There are two rooms, as shown in the image above, and connect them with a two-square-wide aisle.The starting point, ending point, and bending point of ...

2 years ago

1 answers
45 views
0
timing of overlapping intervals

Each has a sequence of 0s and 1s circulating at a certain period.Example: 010101010101...(Period 2)001100110011...(Period 4)000111000111... (Period 6) Now, I would like to find the first column number...

2 years ago

1 answers
153 views
0
Why does String's hashCode() use 31 to multiply?

In Java, the hash code for the String object is s[0]*31n-1 + s[1]*31n-2 + ... + s[n-1] is calculated like this. To illustrate the above equation, s[i] is the ith character in the string, n is the leng...

2 years ago

1 answers
53 views
0
To obtain all possible permutations from a list

How do we find all possible permutations as elements of the list?For example, permutations([1, 2]) ->[1, 2][2, 1]permutations([1, 2, 3]) ->[1, 2, 3][1, 3, 2][2, 1, 3][2, 3, 1][3, 1, 2][3, 2, 1]W...


1 answers
47 views
0
Algorithm to determine if two lists are identical when represented as circular lists

How do I find out if the two lists are the same when they are represented as circular lists?a[0] = [1, 1, 1, 0, 0]a[1] = [1, 1, 0, 0, 1]a[2] = [0, 1, 1, 1, 0]These three are not the same list when vie...

2 years ago

1 answers
129 views
0
How do you know if a binary tree is in balance?

I am reviewing the class I took at school during the winter vacation. I have a question while studying this tree. I wonder what the best way to find out if the height of the tree is balanced. I think ...


1 answers
51 views
0
ArrayIndexOutOfBoundsException error while solving algorithm problem with Java.

Baekjun online jersey is solving a problem, but there is no answer...There is no error when coding with C, but if (arr[x][y-1] == 1 &&y-1 > = 0) line gives java.lang.ArrayIndexOutOfBoundsEx...

2 years ago

3 answers
139 views
0
Linux command ls -s question

Can you tell me the unit of file size that comes out when I do Linux ls -s?


2 answers
80 views
0
Is there a way to solve a programming problem (for simple algorithms or exercises)?

Hello, I am studying coding on my own. I also use the tryhelloworld.co.kr site. But if I try to solve the practice question to test what I learned, I don't know how to approach it and how to make the ...

2 years ago

2 answers
49 views
0
Product algorithm problem

With a 0.006% chance,The 2nd place with 0.03% chanceThe 3rd place with a 0.2% chanceThe rest is blank I don't know how to implement this product when there is a product like this. Also, how can I impl...

2 years ago
« - 12 - »

© 2024 OneMinuteCode. All rights reserved.