Java 5

[leetcode] Squares of a Sorted Array

https://leetcode.com/explore/learn/card/fun-with-arrays/523/conclusion/3574/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com Success 오름차순으로 정렬된 배열이 주어졌을 때 , 각 원소의 값을 제곱한 후 오름차순 되어 있는 상태로 반환 해야한다. 풀이 각 원소에 값을 제곱을 하여 새로 값..

알고리즘 2021.09.03

[leetcode] Find All Numbers Disappeared in an Array

https://leetcode.com/explore/learn/card/fun-with-arrays/523/conclusion/3270/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com Success 위 문제는 n 만큼의 길이를 가진 배열이 주어졌을 때, 해당 원소의 값이 1부터 ~ n까지로 채워져야 하는데 1~n 사이에 값 중 없는 값을 찾아서 Lis..

알고리즘 2021.09.03

[leetcode] Third Maximum Number

https://leetcode.com/explore/learn/card/fun-with-arrays/523/conclusion/3231/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com Success 해당 문제는 배열이 주어졌을 때 세번째로 큰 값을 리턴하는 문제이다. 이때 배열의 길이가 3보다 작을경우엔 가장 큰 값을 리턴하며, 중복된 원소는 하나의 ..

알고리즘 2021.09.03

[leetcode] Max Consecutive Ones II

https://leetcode.com/explore/featured/card/fun-with-arrays/523/conclusion/3230/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com -> Fail 0과 1로 이루어진 특정 배열이 주어졌을때, 최대 한개의 0을 뒤짚을 수 있는 경우 연속되는 1의 개수가 가장 긴 값을 구하는 문제이다. 1. Bru..

알고리즘 2021.09.03

HashTable

1. HashTable 이란? ㄴ Key & Value 로 데이터를 저장하는 자료구조 ㄴ 데이터 검색이 빠르다는 장점을 가지고 있다. ㄴ 내부적으로는 고유한 인덱스를 가진 버킷과 해시함수를 이용하여 값을 저장한다. (대표 버킷은 배열) ㄴ 예를들어, 검색하고자 하는 Key 를 입력받으면, 해시함수를 이용하여 해시코드를 반환받고, 해시코드를 버킷의 인덱스로 환산해서 데이터에 접근하는 방식의 자료구조이다. ( * 해시를 이용하면 데이터 암호화, 간소화를 통하여 빠른비교가 가능하다. ) 2. HashTable 장점 Func(Key) → HashCode → Index → Value 검색속도가 빠르다. ㄴ 해시함수를 통해 만든 해시코드는 정수이다. ㄴ 버킷공간을 고정된 크기만큼 미리 만들어놓고, 해시코드를 배열의..

자료구조 2021.08.21