본문 바로가기

CS/Algorithm17

When to Choose Which algorithm method 05.23.2023 0. Background There are tons of algorithm methods to solve problems out there and it sometimes confuses people with when an algorithm method is appropriate. In this article, I'd like to give suggestions through some situations. 1. DFS Can be used as broute force When a graph to be searched is large (the numorous number of nodes and edges) When you need to keep a track of features of r.. 2023. 5. 18.
1717 set expression (집합의 표현) with Union-Find in Python3 0. Background To explain why this problem should be solved with union-find not Set in Python. 1. Union-Find 1-1. What is it? A data structure to handle data that is splited in subsets. It is also a sort of disjoint-set. 1-2. How does it work? As the name sounds like, this algorithm is used to get disjoint-set by unioning nodes and finding parents. 1-2-1. Find Find is implemented with a recursive.. 2023. 4. 23.
18258 Queue2(큐2) with Python3 2023.02.24 0. Background Queue 1 problem in baekjoon has been done but queue 2 problem has to be O(1) in time complexity. I could not solve this on my own and would like to write down here what I've found and learnt to resolve it. 1. Issue 1-1. Queue 1 code n = int(input()) queue = [] commands = [input() for _ in range(n)] for command in commands: if "push" in command: queue.append(int(command.s.. 2023. 2. 24.
2839 Sugar Delivery (설탕배달) with Greedy Algorithm 2023-02-14 0. Background I'd like to review through what greedy algorithm is and how to apply it to problem solving. 1. Greedy Algorithm The definition of greedy algorithm is to choose the best option on each stage to get the answer. It does not give you the ultimate answer but it does give you the almost ultimate and optimal answer. The core of greedy algorithm is to set the definition of what .. 2023. 2. 14.
1620 pokemon (나는야 포켓몬 마스터 이다솜) with Set and Map 2023-01-27 0. Background This problem is included in Set and Map category. Through the several time of try, there were some things I wanted to write down. There are more things you can learn and I leared. If you want more about this, visit the link. https://blog.loginradius.com/identity Identity | LoginRadius Blog Identity Blog is a place for developers to share their expertise, find solutions f.. 2023. 1. 27.
10815_숫자 카드(Cards) with Set and Map 2023.01.24 0. Background This problem has been assigned in Set and Map category. I would like to explore those with this problem. 1. Set 1-1. What is Set? Accodring to the official document, it is explain that Set is used to store multiple items in a single valiable. This line doesn't seem to make any difference from other types of variable such as list, tuple, and dictionary. But its characteri.. 2023. 1. 24.