일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
- MDP
- CPP
- autonomous vehicle
- 정적라이브러리
- C++
- Leetcode
- C
- 공유라이브러리
- GIT
- path planning
- 동적라이브러리
- PathPlanning
- 강화학습
- Recursion
- DynamicProgramming
- CUDA
- Graph Neural Network
- Frenet Coordinate
- solver
- OSQP
- 수치최적화
- Hybrid A star
- 소프티어
- Dubins Path
- 선형대수
- 백준
- self driving car
- 경로생성
- GNN
- Motion Planning
- Today
- Total
목록개념공부/C, C++ (12)
Swimmer
std::map Maps are associative containers that store elements formed by a combination of a key value and mapped value. The key values are generally used to sort and uniquely identify the elements The mapped values store the content associated to this key. The types of key and mapped value may differ. and both are grouped together by pair type typedef pair value_type; Internally, the elements in a..
Solution Brute Force Time Complexity : O(N^2) Space Omplexity : O(1) class Solution { public: vector twoSum(vector& nums, int target) { vector RetVal; for (int i = 0; i != nums.size(); ++i) { for (int j = i + 1; j != nums.size(); ++j) { if ((nums[i] + nums[j]) == target) { RetVal.push_back(i); RetVal.push_back(j); return RetVal; } } } RetVal.push_back(-1); RetVal.push_back(-1); return RetVal; } };
Solution Use Queue First time to use C++ STL, it is very useful than coding data structure one by one in C #include #include // BFS Solution // Use Queue // Use STL -> Easy typedef struct myStruct { int RowIdx; int ColumnIdx; int depth; }myStruct; using namespace std; void BFS(int row, int column, queue* pmy_queue, vector* pmyvector); int gArr[100][100] = { 0 }; int main() { queue my_queue; vect..
참조 자료 : https://en.cppreference.com/w/cpp/container/unordered_map std::unordered_map - cppreference.com (1) (since C++11) (2) (since C++17) Unordered map is an associative container that contains key-value pairs with unique keys. Search, insertion, and removal of elements have average constant-time complexity. Internally, the elements are not sorted in any p en.cppreference.com 헤더파일 #include Uno..