Skip to content

Conversation

@yusuf601
Copy link
Member

@yusuf601 yusuf601 commented Sep 9, 2025

feat: Judul Perubahan

feat: menambahkan method swap stack linked list

void swap(Stack& others){
    //swap head
    Node* tempHead = head;
    head = others.head;
    //swap size
    int tempSize = size;
    size = others.size;
    others.size = tempSize;
}

Checklist

Umum:
  • [x ] Saya menambah algoritma terbaru.
  • [x ] Saya menambah dokumentasi.
Contributor Requirements (Syarat Kontributor) dan Lain-Lain:
  • [ x] Saya telah menambahkan komentar kode yang memberikan penjelasan maksud dari kode yang saya buat.
  • [x ] Saya menggunakan bahasa Indonesia untuk memberikan penjelasan dari kode yang saya buat.

Environment

Saya menggunakan (I'm using):

  • OS = linux
  • g++ = 15.2.1

Link Issues

Issues: #


License

This Commit License
https://github.com/Build-X-From-Scratch/Stack_Scratch/blob/main/LICENSE

Node* tempHead = head;
head = others.head;
//swap size
int tempSize = size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change implementation this,do not use size and add noexcexcept keyword

@yusuf601 yusuf601 merged commit 7e0d512 into Build-X-From-Scratch:main Sep 11, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants