Giter Site home page Giter Site logo

codingtest's Introduction

Coding Test

Algorithm

μ•Œκ³ λ¦¬μ¦˜ 및 자료ꡬ쑰

    1. 그리디 μ•Œκ³ λ¦¬μ¦˜
    • μš°μ„ μˆœμœ„ 큐
      • import heapq
    1. κ΅¬ν˜„
    1. BFS/DFS
    • BFS
      • Queue
      • λ„ˆλΉ„ μš°μ„  νƒμƒ‰μ΄λΌλŠ” μ˜λ―Έμž…λ‹ˆλ‹€. κ°€κΉŒμš΄ λ…Έλ“œλΆ€ν„° νƒμƒ‰ν•˜λŠ” μ•Œκ³ λ¦¬μ¦˜
    • DFS
      • Stack, Recursion
      • 깊이 μš°μ„  탐색이라고 λΆ€λ₯΄λ©°, κ·Έλž˜ν”„μ—μ„œ κΉŠμ€ 뢀뢄을 μš°μ„ μ μœΌλ‘œ νƒμƒ‰ν•˜λŠ” μ•Œκ³ λ¦¬μ¦˜
    1. μ •λ ¬
    • 선택정렬
    • μ‚½μž…μ •λ ¬
    • 퀡정렬
    • κ³„μˆ˜μ •λ ¬
    1. 이진탐색
    • νŒŒλΌλ©”νŠΈλ¦­ μ„œμΉ˜
    • 라이브러리 ν™œμš©
      • from bisect import bisect_left, bisect_right
    1. DP

μ΄μ½”ν…Œ ν…œν”Œλ¦Ώ

  • macOS
import time
import resource
import sys

def memory_usage():
    usage = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
    if sys.platform == 'darwin':
        # macOS
        return usage / 1024.0 / 1024.0  # KB λ‹¨μœ„λ₯Ό MB둜 λ³€ν™˜

start_time = time.time()
start_memory_usage = memory_usage()

# μ½”λ”© ν…ŒμŠ€νŠΈ μ½”λ“œ μ‹œμž‘
print('μ •λ‹΅:')
# μ½”λ”© ν…ŒμŠ€νŠΈ μ½”λ“œ 끝

end_memory_usage = memory_usage()
end_time = time.time()
execution_time_ms = (end_time - start_time) * 1000

memory_usage_MB = end_memory_usage - start_memory_usage
print("λ©”λͺ¨λ¦¬ μ‚¬μš©λŸ‰: {:.2f} MB".format(memory_usage_MB))
print("μ‹€ν–‰ μ‹œκ°„(ms): {:.2f} ms".format(execution_time_ms))
  • window
import psutil
import time
import sys

start_time = time.time()
start_memory_usage = psutil.Process().memory_info().rss
input = sys.stdin.readline

# μ½”λ”© ν…ŒμŠ€νŠΈ μ½”λ“œ μ‹œμž‘
print('μ •λ‹΅:')
# μ½”λ”© ν…ŒμŠ€νŠΈ μ½”λ“œ 끝

end_memory_usage = psutil.Process().memory_info().rss
end_time = time.time()
execution_time_ms = (end_time - start_time) * 1000

memory_usage_MB = (end_memory_usage - start_memory_usage) / (1024 * 1024)
print("λ©”λͺ¨λ¦¬ μ‚¬μš©λŸ‰: {:.2f} MB".format(memory_usage_MB))
print("μ‹€ν–‰ μ‹œκ°„(ms): {:.2f} ms".format(execution_time_ms))

μ°Έκ³ 

이것이 취업을 μœ„ν•œ μ½”λ”© ν…ŒμŠ€νŠΈλ‹€

leetcode

codeup

codingtest's People

Contributors

jasonsong97 avatar

Watchers

 avatar

codingtest's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.