목록실무 (2)
오븐 노트
#include using namespace std; #include #include #include #include class Player { public: public: Player() : _playerId(0) { } Player(int playerId) : _playerId(playerId) { } public: int _playerId; }; template struct Pair { T1 t1; T2 t2; }; int main() { // 연관 컨테이너 // map : 균형 이진 트리 (AVL) // - 노드 기반 class Node { public: Node* _left; Node* _right; // DATA pair _data; //int _key; //Player* _value; }; ..
#include using namespace std; #include int main() { // STL (Standard Template Library) // 프로그래밍 할 때 필요한 자료구조 / 알고리즘들을 템플릿으로 제공하는 라이브러리 // 컨테이너(Container) : 데이터를 저장하는 객체 (자료구조 Data Structure) // vector (동적 배열) // - vector의 동작 원리 (size/capacity) // - 중간 삽입/삭제 // - 처음/끝 삽입/삭제 // - 임의 접근 // 동적 배열 /*int arr[100]; // 대충 예를 들어 이런 느낌 int* arr2 = new int[100]; delete arr2; arr2 = new int[1000];*/ // 1) (..