๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์ „์ฒด ๊ธ€

(377)
[Java] Thread์˜ stop()๊ณผ interrupt()์˜ ๋น„๊ต ์ถœ์ฒ˜ChatGPT์ž๋ฐ” 8 ์†Œ์Šค ์ฝ”๋“œhttps://cano721.tistory.com/165 [Java] ์“ฐ๋ ˆ๋“œ 5 - ์“ฐ๋ ˆ๋“œ์˜ ์‹คํ–‰์ œ์–ด(sleep, interrupt, join, yield)์“ฐ๋ ˆ๋“œ์˜ ์Šค์ผ€์ค„๋ง ๊ด€๋ จ ๋ฉ”์„œ๋“œ ๋ฉ”์„œ๋“œ ์„ค ๋ช… static void sleep(long millis) static void sleep(long millis, int nanos) ์ง€์ •๋œ ์‹œ๊ฐ„(์ฒœ๋ถ„์˜ 1์ดˆ ๋‹จ์œ„)๋™์•ˆ ์“ฐ๋ ˆ๋“œ๋ฅผ ์ผ์‹œ์ •์ง€์‹œํ‚จ๋‹ค. ์ง€์ •ํ•œ ์‹œ๊ฐ„์ด ์ง€๋‚˜๊ณ  ๋‚˜๋ฉด,cano721.tistory.com  ์ž๋ฐ”์˜ Thread.stop() ๋ฉ”์†Œ๋“œ๋Š” ์Šค๋ ˆ๋“œ๋ฅผ ๊ฐ•์ œ๋กœ ์ข…๋ฃŒ์‹œํ‚ค๋Š” ์œ„ํ•œ ํ•จ์ˆ˜๋กœ deprecated ๋๋‹ค. stop()์˜ ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์œ„ํ•ด interrupt() ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด ์Šค๋ ˆ๋“œ๋ฅผ ์ข…๋ฃŒํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค.  Threa..
[Java] ์Šค๋ ˆ๋“œ ์ƒ๋ช…์ฃผ๊ธฐ ์ถœ์ฒ˜ChatGPThttps://www.baeldung.com/java-thread-lifecycle  ์ž๋ฐ”์˜ ์Šค๋ ˆ๋“œ ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ์™œ ์•Œ์•„์•ผ ํ•˜๋Š”๊ฐ€๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํšจ๊ณผ์ ์œผ๋กœ ์ž‘์„ฑํ•˜๊ณ  ๋””๋ฒ„๊น…ํ•˜๋Š” ๋ฐ ํ•„์ˆ˜์ ์ด๋‹ค.1. ์ž์› ๊ด€๋ฆฌ์Šค๋ ˆ๋“œ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ์‹œ์Šคํ…œ ์ž์›์„ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์Šค๋ ˆ๋“œ์˜ ์ƒํƒœ๋ฅผ ์ดํ•ดํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•˜๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ํ•„์š”ํ•˜์ง€ ์•Š์€ ์Šค๋ ˆ๋“œ๊ฐ€ ๊ณ„์† ์‹คํ–‰๋˜๋ฉด ์ž์› ๋‚ญ๋น„๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.2. ๋™๊ธฐํ™” ๋ฌธ์ œ ํ•ด๊ฒฐ์Šค๋ ˆ๋“œ๊ฐ€ ์–ธ์ œ ์‹คํ–‰๋˜๊ณ  ์–ธ์ œ ๋ฉˆ์ถ”๋Š”์ง€๋ฅผ ์ดํ•ดํ•˜๋ฉด ๋™๊ธฐํ™” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋œ๋‹ค. ์ž˜๋ชป๋œ ๋™๊ธฐํ™”๋Š” ๋ฐ๋“œ๋ฝ์ด๋‚˜ ๋ ˆ์ด์Šค ์ปจ๋””์…˜๊ณผ ๊ฐ™์€ ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚ฌ ์ˆ˜ ์žˆ๋‹ค.๋ฐ๋“œ๋ฝ Deadlock : ๋‘ ๊ฐœ ์ด์ƒ์˜ ์Šค๋ ˆ๋“œ๊ฐ€ ์„œ๋กœ ์ƒ๋Œ€๋ฐฉ์˜ ์ž์›์„ ๊ธฐ๋‹ค๋ฆฌ๋ฉฐ ๋ฌดํ•œํžˆ ๋Œ€๊ธฐํ•˜๋Š” ์ƒํƒœ. ์ด ์ƒํƒœ์—์„œ๋Š” ์–ด๋–ค ์Šค๋ ˆ..
[์ž๋ฃŒ๊ตฌ์กฐ] ํ•ด์‹œ ์ถฉ๋Œ Hash Collision ์ถœ์ฒ˜https://ryu-e.tistory.com/87 ํ•ด์‹œ(Hash)์™€ ํ•ด์‹œ ์ถฉ๋Œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•1. ํ•ด์‹œ๋ž€? ๐Ÿ’ก ๋ฐ์ดํ„ฐ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ž„์˜์˜ ๊ธธ์ด ๋ฐ์ดํ„ฐ๋ฅผ ๊ณ ์ •๋œ ๊ธธ์ด์˜ ๋ฐ์ดํ„ฐ๋กœ ๋งคํ•‘ ํ•ด์‹œ ํ•จ์ˆ˜: ๋ฐ์ดํ„ฐ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ž„์˜์˜ ๊ธธ์ด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜ํ•™์  ์—ฐ์‚ฐ์„ryu-e.tistory.com https://www.geeksforgeeks.org/introduction-to-hashing-2/ Introduction to Hashing - GeeksforGeeksA Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming ..
[Java] Retrofit2์—์„œ Annotation์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• ์‚ดํ”ผ๊ธฐ ์ถœ์ฒ˜https://github.com/square/retrofit GitHub - square/retrofit: A type-safe HTTP client for Android and the JVMA type-safe HTTP client for Android and the JVM. Contribute to square/retrofit development by creating an account on GitHub.github.comChatGPT๋ชฉํ‘œ์ปค์Šคํ…€ Annotation ํ™œ์šฉ๋ฒ•์„ Retrofit์„ ํ†ตํ•ด์„œ ๋ฐฐ์šด๋‹ค. ์–ด๋–ป๊ฒŒ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๋Š”์ง€ ์‚ดํ•€๋‹ค.์ƒ์„ธํ•œ Annotation ์‚ฌ์šฉ ๋ฐ ๊ตฌํ˜„ ์‚ฌํ•ญ๊นŒ์ง€๋Š”... ๐Ÿ™ˆ ๋ถ€๋‹ด์Šค๋Ÿฌ์›Œ์š”.Retrofit์—์„œ Annotation์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ์‹์˜ ์žฅ์ ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ ํ–ฅ์ƒAn..
[Java] PriorityQueue ์ถœ์ฒ˜ChatGPT์ž๋ฐ” 8 ์†Œ์Šค์ฝ”๋“œPriorityQueue๋Š” ์ž๋ฐ”์˜ ํ(queue) ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•œ ํด๋ž˜์Šค ์ค‘ ํ•˜๋‚˜๋กœ, ์šฐ์„ ์ˆœ์œ„์— ๋”ฐ๋ผ ์š”์†Œ๋“ค์„ ๊ด€๋ฆฌํ•˜๋Š” ํ์ด๋‹ค. PriorityQueue๋Š” ํž™(Heap) ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ž‘ํ•˜๋ฉฐ, ์‚ฝ์ž…๋œ ์š”์†Œ๋“ค์„ ํŠน์ • ์šฐ์„ ์ˆœ์œ„์— ๋”ฐ๋ผ ์ •๋ ฌํ•˜์—ฌ, ๊ฐ€์žฅ ๋†’์€ ์šฐ์„ ์ˆœ์œ„๋ฅผ ๊ฐ€์ง„ ์š”์†Œ๊ฐ€ ๋จผ์ € ์ฒ˜๋ฆฌ๋˜๋„๋ก ํ•œ๋‹ค.๊ด€๋ จ ๊ธ€ -> [Java] Queue ์ธํ„ฐํŽ˜์ด์Šค๊ด€๋ จ ๊ธ€ -> [์ž๋ฃŒ ๊ตฌ์กฐ][Java] ํž™ Heap 1. PriorityQueue์˜ ์ฃผ์š” ํŠน์ง•์šฐ์„ ์ˆœ์œ„ ๊ธฐ๋ฐ˜PriorityQueue๋Š” ์ผ๋ฐ˜์ ์ธ ํ์™€ ๋‹ฌ๋ฆฌ, ์š”์†Œ๋“ค์ด ์šฐ์„ ์ˆœ์œ„์— ๋”ฐ๋ผ ์ •๋ ฌ๋œ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌ๋˜๋ฉฐ, Comparator๋ฅผ ์ œ๊ณตํ•˜๋ฉด ์‚ฌ์šฉ์ž ์ •์˜ ์šฐ์„ ์ˆœ์œ„๋กœ ์ •๋ ฌํ•  ์ˆ˜ ์žˆ๋‹ค.ํž™(Heap)  ์ž๋ฃŒ๊ตฌ์กฐ๋‚ด๋ถ€์ ์œผ๋กœ..
[์ž๋ฃŒ ๊ตฌ์กฐ]์ด์ง„ ํž™ Binary Heap ์ถœ์ฒ˜ ChatGPT์ด์ง„ ํž™ (Binary Heap)์€ ์™„์ „ ์ด์ง„ ํŠธ๋ฆฌ์˜ ํ•œ ํ˜•ํƒœ๋กœ, ํž™ ํŠน์„ฑ์„ ๋งŒ์กฑํ•˜๋Š” ์ž๋ฃŒ๊ตฌ์กฐ์ด๋‹ค. ์ด์ง„ ํž™์€ ์ฃผ๋กœ ์ตœ์†Œ ํž™(Min Heap)๊ณผ ์ตœ๋Œ€ ํž™(Max Heap) ๋‘ ๊ฐ€์ง€ ์œ ํ˜•์œผ๋กœ ๋‚˜๋‰œ๋‹ค. ์ตœ์†Œ ํž™ Min Heap๋ถ€๋ชจ ๋…ธ๋“œ๊ฐ€ ํ•ญ์ƒ ์ž์‹ ๋…ธ๋“œ๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ๊ฐ’์„ ๊ฐ€์ง„๋‹ค. ๋”ฐ๋ผ์„œ ๋ฃจํŠธ ๋…ธ๋“œ์—๋Š” ํŠธ๋ฆฌ์—์„œ ๊ฐ€์žฅ ์ž‘์€ ๊ฐ’์ด ์œ„์น˜ํ•œ๋‹ค.์ตœ๋Œ€ ํž™ Max Heap๋ถ€๋ชจ ๋…ธ๋“œ๊ฐ€ ํ•ญ์ƒ ์ž์‹ ๋…ธ๋“œ๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™์€ ๊ฐ’์„ ๊ฐ€์ง„๋‹ค. ๋”ฐ๋ผ์„œ ๋ฃจํŠธ ๋…ธ๋“œ์—๋Š” ํŠธ๋ฆฌ์—์„œ ๊ฐ€์žฅ ํฐ ๊ฐ’์ด ์œ„์น˜ํ•œ๋‹ค. 1. ์ด์ง„ ํž™์˜ ํŠน์„ฑ์™„์ „ ์ด์ง„ ํŠธ๋ฆฌ Complete Binary Tree์ด์ง„ ํž™์€ ์™„์ „ ์ด์ง„ ํŠธ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ์œ ์ง€ํ•ด์•ผ ํ•œ๋‹ค. ์ฆ‰, ๋ชจ๋“  ๋ ˆ๋ฒจ์€ ๊ฐ€๋“ ์ฐจ ์žˆ์œผ๋ฉฐ, ๋งˆ์ง€๋ง‰ ๋ ˆ๋ฒจ์€ ์™ผ์ชฝ๋ถ€ํ„ฐ ์ฐจ๋ก€๋Œ€๋กœ ๋…ธ๋“œ๊ฐ€ ์ฑ„์›Œ์ ธ์•ผ ํ•œ๋‹ค.ํž™ ์†์„ฑ ..
[์ž๋ฃŒ ๊ตฌ์กฐ][Java] ํž™ Heap ์ถœ์ฒ˜ChatGPTํž™(Heap) ์ž๋ฃŒ๊ตฌ์กฐ๋Š” ์™„์ „ ์ด์ง„ ํŠธ๋ฆฌ(Complete Binary Tree)์˜ ํ•œ ํ˜•ํƒœ๋กœ, ์šฐ์„ ์ˆœ์œ„ ํ(Priority Queue)๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๋ฐ ์ฃผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ํšจ์œจ์ ์ธ ์ž๋ฃŒ๊ตฌ์กฐ์ด๋‹ค. ํž™์€ ์š”์†Œ๋“ค์˜ ์šฐ์„ ์ˆœ์œ„๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋น ๋ฅด๊ฒŒ ์ตœ๋Œ€๊ฐ’์ด๋‚˜ ์ตœ์†Œ๊ฐ’์„ ์ฐพ๊ณ , ์‚ฝ์ž… ๋ฐ ์‚ญ์ œ ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค๊ณ„๋˜์—ˆ๋‹ค.๊ด€๋ จ ๊ธ€ -> [์ž๋ฃŒ ๊ตฌ์กฐ] ์ด์ง„ ํŠธ๋ฆฌ Binary Tree 1. ํž™์˜ ์ฃผ์š” ํŠน์ง•์™„์ „ ์ด์ง„ ํŠธ๋ฆฌํž™์€ ๋ชจ๋“  ๋ ˆ๋ฒจ์ด ์™„์ „ํžˆ ์ฑ„์›Œ์ ธ ์žˆ์œผ๋ฉฐ, ๋งˆ์ง€๋ง‰ ๋ ˆ๋ฒจ๋„ ์™ผ์ชฝ๋ถ€ํ„ฐ ์ฑ„์›Œ์ ธ ์žˆ๋Š” ์ด์ง„ ํŠธ๋ฆฌ์ด๋‹ค. ์ด ํŠน์„ฑ ๋•๋ถ„์— ํž™์€ ๋ฐฐ์—ด(Array)๋กœ ํšจ์œจ์ ์œผ๋กœ ๊ตฌํ˜„๋  ์ˆ˜ ์žˆ๋‹ค.ํž™ ์†์„ฑ Heap Property์ตœ๋Œ€ ํž™ Max-Heap๋ถ€๋ชจ ๋…ธ๋“œ์˜ ๊ฐ’์ด ์ž์‹ ๋…ธ๋“œ์˜ ๊ฐ’๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™์€ ๊ตฌ์กฐ์ด๋‹ค. ๋”ฐ๋ผ์„œ ..
[์ฝ๊ธฐ][Android] Could Google Be Forced to Abandon Android? ์ฝ์€ ๊ธ€https://medium.com/generative-ai/could-google-be-forced-to-abandon-android-60a0d3cb1fb0 Could Google Be Forced to Abandon Android?Exploring the Potential Impact of Antitrust Actions on Google’s Android and the Global Smartphone Marketgenerativeai.pub ๊ตฌ๊ธ€์ด ๋…์  ๊ธˆ์ง€ ์กฐ์น˜๋ฅผ ๋ฐ›์Œ-> ๊ตฌ๊ธ€์„ ๋ธŒ๋กœ์šฐ์ €์˜ ๊ธฐ๋ณธ ๊ฒ€์ƒ‰ ํŽ˜์ด์ง€๋กœ ์„ค์ •ํ•˜๋„๋ก ํ•˜๋ฉด์„œ ๋†’์€ ์‹œ์žฅ ์ ์œ ์œจ์„ ์œ ์ง€ํ•˜๋ฉฐ ๊ฒ€์ƒ‰ ์ˆ˜์ต์„ ์ฐฝ์ถœํ–ˆ์—ˆ์Œ->  ์ด ๋…์  ๊ธˆ์ง€ ์‚ฌ๊ฑด์„ ๋‹ด๋‹นํ•œ ํŒ์‚ฌ๋Š” ์•ˆ๋“œ๋กœ์ด๋“œ๋„ ๊ตฌ๊ธ€ ๋…์ ์˜ ์ค‘์š”ํ•œ ๋ถ€๋ถ„์ด๋ผ๊ณ  ํŒ๋‹จํ•จ. ์•ˆ๋“œ๋กœ์ด๋“œ OS ์‹œ์Šคํ…œ..