-
Notifications
You must be signed in to change notification settings - Fork 2
Create brc_test1 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
randomkj
wants to merge
5
commits into
main
Choose a base branch
from
test1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| from random import randint | ||
| import time | ||
|
|
||
| # 배열에 10,000개의 정수를 삽입 | ||
| array = [] | ||
| for _ in range(10000): | ||
| array.append(randint(1, 100)) # 1부터 100 사이의 랜덤한 정수 | ||
|
|
||
| # 선택 정렬 프로그램 성능 측정 | ||
| start_time = time.time() | ||
|
|
||
| # 선택 정렬 프로그램 소스코드 | ||
| for i in range(len(array)): | ||
| min_index = i # 가장 작은 원소의 인덱스 | ||
| for j in range(i + 1, len(array)): | ||
| if array[min_index] > array[j]: | ||
| min_index = j | ||
| array[i], array[min_index] = array[min_index], array[i] # 스와프 | ||
|
|
||
| end_time = time.time() # 측정 종료 | ||
| print("선택 정렬 성능 측정:", end_time - start_time) # 수행 시간 출력 | ||
|
|
||
| # 배열을 다시 무작위 데이터로 초기화 | ||
| array = [] | ||
| for _ in range(10000): | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기는 두번째 내 코멘트 |
||
| array.append(randint(1, 100)) # 1부터 100 사이의 랜덤한 정수 | ||
|
|
||
| # 기본 정렬 라이브러리 성능 측정 | ||
| start_time = time.time() | ||
|
|
||
| # 기본 정렬 라이브러리 사용 | ||
| array.sort() | ||
|
|
||
| end_time = time.time() # 측정 종료 | ||
| print("기본 정렬 라이브러리 성능 측정:", end_time - start_time) # 수행 시간 출력 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| @@ -59,12 +59,12 @@ | ||
| now = q.popleft() | ||
| result.append(now) | ||
| # 해당 원소와 연결된 노드들의 진입차수에서 1 빼기 | ||
| for i in range(1, n + 1): | ||
| if graph[now][i]: | ||
| indegree[i] -= 1 | ||
| for j in range(1, n + 1): | ||
| if graph[now][j]: | ||
| indegree[j] -= 1 | ||
| # 새롭게 진입차수가 0이 되는 노드를 큐에 삽입 | ||
| if indegree[i] == 0: | ||
| q.append(i) | ||
| if indegree[j] == 0: | ||
| q.append(j) | ||
|
|
||
| # 사이클이 발생하는 경우(일관성이 없는 경우) | ||
| if cycle: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import csv | ||
|
|
||
| file_name1 = "weather.csv" | ||
| file_name2 = "weather2.csv" | ||
| f1 = open(file_name1, "r", encoding="utf-8") | ||
| f2 = open(file_name2, "w", encoding="utf-8", newline="") | ||
|
|
||
| lines = csv.reader(f1) | ||
| wr = csv.writer(f2) | ||
|
|
||
| header = next(lines) | ||
|
|
||
| for i in range(5) : | ||
| line = next(lines) | ||
| wr.writerow(line) | ||
|
|
||
| print("파일쓰기 종료!") | ||
|
|
||
| f1.close() | ||
| f2.close() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기에 코드 코멘트