
Intro
Today, we will solve a problem about list in python. Since we know the list structure, there seems to be nothing to write about the concept. So I'll move on to the problem right away. Here's the problem we will solve today : Baekjun 10808. Because it comes out in the lecture I've watch.
The process I 've solved
First of all, I got input to l. And the problem said that only lowercase letters are applicable. I didn't memorize 26 lowercase letters in English. I know it's around that area, but I didn't know anyway, so I counted each and every answer in Baekjun. Anyway, since there are 26 letters, I made 26 columns of zero in the result. And since the function is to convert the alphabet to an ASCII value, I subtracted 96 columns corresponding to a lowercase letter a. And I added the number of columns of the result corresponding to the number one by one. Finally, I printed them out by spacing them out by one. Since an instructor used C++ in the video, I don't know how similar C++ code and Python code are, but it seemed same idea as mine. So for this question, I'll skip the answer sheet.
l = 'baekjoon'
result = [0]*26
for i in range(len(l)) :
a = ord(l[i])
result[a-96] += 1
for i in result :
print(i,end=' ')
I tried to solve additional problems, but there is no list related problems in the high-scoring kit of Programmer's algorithm. There are stack and a queue related problems, but I'll post them separately. so I'm going to skip the list structure related problem and solve another problem quickly. There is an ambiguous part of the data structure, so I want to move on to this part. But wouldn't this part of DFS and BFS be sharply divided?
Linked list and its types
Linked list is a case where each element in an array remembers each other. It is a structure where one does not remember all, but remembers each other. There is a type of linking list: 1. singly linked list 2. double linked list 3. circular linked list. And for that structure, refer to the picture below. The big difference between a simple array and a linked list is to check for elements, add them, and remove them. Whilst the linked list's number of checking has increased (Asking and asking and asking and arrival = O(N)), when add or remove a element, it can only be done by handling the surrounding part(=O(1)). For a normal list structure, not linked list, we can say the opposite.

'IT, Digital' 카테고리의 다른 글
| Blog AdSense Revenue Journey: How to fix the ads.txt issue in Adsense? (0) | 2025.06.02 |
|---|---|
| An application to use desktops remotely from your iPad, Jump Desktop (0) | 2025.06.01 |
| [MySQL] SQL SELF JOIN & DATE type format (0) | 2025.05.31 |
| [MySQL] What is SELF JOIN? (0) | 2025.05.30 |
| [MySQL] How to handle decimal points (0) | 2025.05.29 |
