Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] BOJ1406, LinkedList #10

Open
Settpark opened this issue Sep 22, 2021 · 0 comments
Open

[C++] BOJ1406, LinkedList #10

Settpark opened this issue Sep 22, 2021 · 0 comments
Assignees
Labels
Algorithm Algorithm C++ C++

Comments

@Settpark
Copy link
Owner

  • 연결리스트에서 연결리스트 삭제 시 유의점
    list<char> LL;
    auto t = LL.begin();

    LL.erase(t); // 이 부분과 같이 삭제를 진행하면 안됨. t는 여전히 삭제된 부분을 가리키고 있음
    t = LL.erase(t); // 이 부분과 같이 삭제 후 t를 갱신하여야 합니다.
  • 삽입 시 주의점
    list<char> LL;
    auto t = LL.end();
    LL.insert(t, 0); // t의 **앞에** 0을 삽입하겠다는 의미입니다.
@Settpark Settpark added the C++ C++ label Sep 22, 2021
@Settpark Settpark self-assigned this Sep 22, 2021
@Settpark Settpark added the Algorithm Algorithm label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algorithm Algorithm C++ C++
Projects
None yet
Development

No branches or pull requests

1 participant