일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- Graph Neural Network
- GIT
- 경로생성
- DynamicProgramming
- autonomous vehicle
- Dubins Path
- GNN
- Leetcode
- Recursion
- 백준
- 정적라이브러리
- self driving car
- CUDA
- 선형대수
- Motion Planning
- 수치최적화
- Hybrid A star
- OSQP
- path planning
- solver
- 공유라이브러리
- 강화학습
- Frenet Coordinate
- CPP
- 동적라이브러리
- C
- C++
- MDP
- 소프티어
- PathPlanning
- Today
- Total
목록전체 글 (128)
Swimmer
Function Algorithm for finding the shortest paths between nodes in a graph It fixes a single node as the "source" node and finds shortest paths from the source to all other nodes in a graph It uses a data structure for storing and querying partial solutions sorted by distance from the "source" node (Queue, prioirty - Queue in C++) Time Complexity prioirty queue - $$ \Theta ((\left| V \right| + \..
Solution use recursive structure Tag Full binary tree class Solution { public: bool evaluateTree(TreeNode* root) { bool retval = true; if (root->left != nullptr && root->left != nullptr) // full binary tree { if (root->val == 2) // OR { retval = evaluateTree(root->left) || evaluateTree(root->right);; } else // operta = 3, AND { retval = evaluateTree(root->left) && evaluateTree(root->right);; } }..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/drh8Hb/btrVKZENsIu/38D0LzTYgEy1ezwht9Aemk/img.png)
문제 원인 함수와 변수가 구분되지 않는 경우 발생 대표적인 경우는 함수명과 동일한 변수가 존재하는 경우 예제 아래 코드에서는 maxRepeating과 이름이 동일한 변수가 함수의 출력 값을 저장하도록 선언됨 함수와 변수명이 같아 함수를 구분하지 못해 컴파일러가 에러를 발생시킴 #include int maxRepeating(char* sequence, char* word); int main() { char sequence[] = "aaabaaaabaaabaaaabaaaabaaaabaaaaba"; char word[] = "aaaba"; int maxRepeating = maxRepeating(sequence, word); return 0; }
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; } };