SlideShare a Scribd company logo
1 of 14
Download to read offline
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                  DUY TAN UNIVERSITY
                                INTERNATIONAL SCHOOL




                            ASSIGNMENT
    Computer Science for Practicing Engineering
                                        **********




             Faculty:            HUỲNH BÁ DIỆU


             Student's name:     NGUYỄN ĐÌNH NHẬT
                                 NGUYỄN NHƯ HẢI TRIỀU

             Class:              K15CMU-TCD1




                                  Da Nang, 28/05/2011


Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 1 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                          ASSIGNMENT


Reqest: Swap N number of blue balls and red ball.

Example: Enter N is 3.
Total ball: 3 red balls + 3 blue balls = 6 balls
Total cells: 6 balls + 1 empty = 7 cells




                                        Describe project:

      In this project, we use Double Link List to keep balls. We use Node to keep
information. Information of Node include Data (Red, Blue or Empty), Next ( Next Node), and
Previous (Previous Node). Additionally, We use HEAD node and TAIL node to define the first
node and the last node.



                                   Describe the way of sort:

       Enter any N “number”. We create Double Link List to include 2*N+1 Node. It incude N
red balls, N blue balls and 1 Empty Node.
       Move by one blue ball from left to right. Then move the box from right to left (blue ball
next to last). Continue to moving all blue ball to the right. Move the empty cell into position
between red and green balls.
       However, in this algorithm, we have two case to comeback. If N is even number or N is
odd number. With N is even number, we swap empty cell for pre-pre-emptycell, and continue
to moving Blue ball to an adjacent empty square. With N is odd number, we use a nother
way. We need two steps to move the ball on the desired location.




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1             Page 2 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                    Describe algorithm:



      Create Node:

  Node          Describe          Type
   Data    Red, Blue or Empty Char
   Next    Next Node             Node
   Prev    Previous Node         Node

      Enter N number: 2

      Create Double Link List:




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 3 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                               Describe algorithm by chart




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 4 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                           Describe algorithm by Pseudocode


int checkList = 0;
       while(checkList!=n)
              nodeRef = Head;
              while(nodeRef.next.data!='*')
                    nodeRef = nodeRef.next;
              recheck condition.

             // nodeRef == REDball
             while (REDball != Tail && Next-REDball == EMPTYcell)
                   change REDball for EMPTYcell in the next.
                   if(REDball !=Tail && Next-REDball == BLUEball)
                         change EMPTYcell (behind REDball) for BLUEball (in front of it);



             if(++checkList==n) Finish algorithm and print result.

             nullNode = nodeRef.prew;
             // nodeRef ==EMPTYcell

             while (Prev-EMPTYcell != BLUEball && Prev-EMPTYcell != Head)
                   if ( Prev-Prev-EMPTYcell != BLUEball)
                           change EMPTYcell for Prev-Prev-EMPTYcell.
                   else
                           change EMPTYcell for Prev-Prev-EMPTYcell.
                           change EMPTYcell for Next-EMPTYcell
                           change EMPTYcell for Next-Next-EMPTYcell




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 5 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                     Describe by model

With N = 2 (even number)
Total steps: 11




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 6 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


With N = 3 (odd number)
Total steps: 21




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 7 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 8 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                    CODE: LinkList class

/*
 * Object: Computer Science for Practicing Engineering
 * Faculty Huynh Ba Dieu
 * Authors:
 *           1. Nguyen Dinh Nhat
 *           2. Nguyen Nhu Hai Trieu
 * Class: K15CMU-TCD1 -- International School -- Duy Tan University
 * 05/2011
 */

import java.util.*;
public class LinkList {

      // Node class
      class Node {
            char data;
            Node next,prew;

             //Method: create a node
          Node(char x)
          {
            data=x;
            next=prew=null;
          }
          Node(char x, Node t)
          {
            data = x;
            next = prew = null;
            if(t!=null)
            {
                next = t;
                t.prew = this;
            }
          }
      }

      Node Head, Tail;
      Node nullNode;
      Node nodeRef;
      static int count=0;
      static int n;

      //Method: create null Link List
      LinkList(){


Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1           Page 9 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


             Head=Tail=null;
      }


      //Method: create Link Link with data
      void createLinkList() {
            char x = 'B';
            for(int i=1;i<=2*n+1;i++) {
                   if(i<n+1)x='B';
                   else
                          if(i==n+1)x='*';
                          else
                                 x='R';
                   Node t = new Node(x,null);
                   if(Head==null) Head=Tail=t;
                   else { Tail.next = t; t.prew = Tail; Tail = t;}
            }
      }

     //Method: display LinkList from HEAD to TAIL
  void display() {
     Node p = Head;
        System.out.print("| ");
        while(p!=null) {
            System.out.print(p.data + " | ");
           p = p.next;
        }
        System.out.println("");
     }

  //Method: display LinkList from TAIL to HEAD
  void display2() {
     Node p = Tail;
     System.out.print("| ");
     while(p!=null) {
       System.out.print(p.data + " | ");
       p = p.prew;
     }
     System.out.println("");
  }

  //Method: swap ball
  void changeBall() {
     int checkList = 0;
     while(checkList!=n){
            nodeRef = Head;


Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1          Page 10 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


            while(nodeRef.next.data!='*') {
                   nodeRef = nodeRef.next;
            }
      while(nodeRef!=Tail && nodeRef.next.data=='*'){
            this.change2Ball(nodeRef, nodeRef.next);
            if(nodeRef!=Tail && nodeRef.next.data=='R') {
                   this.change3Ball(nodeRef.prew, nodeRef, nodeRef.next);
            }
      }

             if(++checkList==n) return;

             nullNode = nodeRef.prew;

             while(nullNode.prew.data!='B' && nullNode.prew!=Head){
                   if(nullNode.prew.prew.data!='B')
                           this.change3Ball(nullNode.prew.prew, nullNode.prew, nullNode);
                   else {
                           this.change3Ball(nullNode.prew.prew, nullNode.prew, nullNode);

                           this.change2Ball(nullNode, nullNode.next);
                           this.change3Ball(nullNode, nullNode.next, nullNode.next.next);
                    }
             }
      }
  }

  //Sub method
  void display3(){
      count++;
            System.out.print(" " + count + " times:t");
            this.display();
  }

  //Method: move a ball to an adjacent empty square (forwards or backwards)
  void change2Ball(Node a, Node b) {
     if(a.prew!=null && b.next!=null){
            b.next.prew = a;
            a.prew.next = b;
            a.next = b.next;
            b.prew = a.prew;
            b.next = a;
            a.prew = b;
     }
     else
            if(a == Head){


Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1          Page 11 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                    b.prew = null;
                    b.next.prew = a;
                           a.next = b.next;
                           b.next = a;
                           a.prew = b;
                           Head = b;
             }
             else
                   if(b == Tail){
                          a.next = null;
                   a.prew.next = b;
                   b.prew = a.prew;
                   b.next = a;
                   a.prew = b;
                   Tail = a;
                   }
      this.display3();
  }

  //Method: jump a single adjacent ball into an empty square (forwards or backwards)
  void change3Ball(Node a, Node b, Node c) {
     if(a == Head && c == Tail){
            a.next = null;
            a.prew = b;
            c.next = b;
            c.prew = null;
            b.next = a;
            b.prew = c;
            Head = c;
            Tail = a;
     }
     else
            if(c.next!=null && a.prew!=null){
                   c.next.prew = a;
                   c.prew = a.prew;
                   a.prew.next = c;
                   a.next = c.next;
                   a.prew = b;
                   b.prew = c;
            c.next = b;
            b.next = a;
            }
            else
                   if(a == Head){
                                c.next.prew = a;
                                a.prew = b;


Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1          Page 12 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                  b.prew = c;
                                  c.prew = null;
                                  a.next = c.next;
                                  b.next = a;
                                  c.next = b;
                                  Head = c;
                     }
                     else
                            if(c == Tail){
                            a.prew.next = c;
                            c.next = b;
                            b.next = a;
                                   a.next = null;
                            c.prew = a.prew;
                            b.prew = c;
                            a.prew = b;
                            Tail = a;
                            }
        this.display3();
    }

    //Main method
    public static void main (String [] ndnhat){
       LinkList ll = new LinkList();
       Scanner kb = new Scanner(System.in);
       System.out.println(" ********* Final-Project: Swap Ball ********");
       System.out.print(" Enter N: ");
       n = kb.nextInt();
       ll.createLinkList();
       System.out.print(" LinkList :t");
       ll.display();
       System.out.println("n");
       ll.changeBall();
       System.out.println("");
       System.out.print(" LinkList :t");
       ll.display();
       System.out.println(" Total times of swap: "+count);
    }
}




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1          Page 13 of 14
Computer Science for Practicing Engineering                               DUY TAN UNIVERSITY


                                              RESULT




Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1          Page 14 of 14

More Related Content

What's hot

Introduction - Lattice-based Cryptography
Introduction - Lattice-based CryptographyIntroduction - Lattice-based Cryptography
Introduction - Lattice-based CryptographyAlexandre Augusto Giron
 
Lattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH CryptosystemLattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH CryptosystemVarun Janga
 
Numerical approach for Hamilton-Jacobi equations on a network: application to...
Numerical approach for Hamilton-Jacobi equations on a network: application to...Numerical approach for Hamilton-Jacobi equations on a network: application to...
Numerical approach for Hamilton-Jacobi equations on a network: application to...Guillaume Costeseque
 
Tensorizing Neural Network
Tensorizing Neural NetworkTensorizing Neural Network
Tensorizing Neural NetworkRuochun Tzeng
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice CryptographyPriyanka Aash
 
Cyclic code systematic
Cyclic code systematicCyclic code systematic
Cyclic code systematicNihal Gupta
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithmguest862df4e
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Nguyễn Công Hoàng
 
Parallel Optimization in Machine Learning
Parallel Optimization in Machine LearningParallel Optimization in Machine Learning
Parallel Optimization in Machine LearningFabian Pedregosa
 
Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Oswald Campesato
 
Graph Kernels for Chemical Informatics
Graph Kernels for Chemical InformaticsGraph Kernels for Chemical Informatics
Graph Kernels for Chemical InformaticsMukund Raj
 
Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Visionzukun
 
Random Forest for Big Data
Random Forest for Big DataRandom Forest for Big Data
Random Forest for Big Datatuxette
 
Eight Formalisms for Defining Graph Models
Eight Formalisms for Defining Graph ModelsEight Formalisms for Defining Graph Models
Eight Formalisms for Defining Graph ModelsJérôme KUNEGIS
 
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMS
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMSON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMS
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMScscpconf
 

What's hot (20)

CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN7)
 
Introduction - Lattice-based Cryptography
Introduction - Lattice-based CryptographyIntroduction - Lattice-based Cryptography
Introduction - Lattice-based Cryptography
 
Lattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH CryptosystemLattice Based Cryptography - GGH Cryptosystem
Lattice Based Cryptography - GGH Cryptosystem
 
Lecture26
Lecture26Lecture26
Lecture26
 
Numerical approach for Hamilton-Jacobi equations on a network: application to...
Numerical approach for Hamilton-Jacobi equations on a network: application to...Numerical approach for Hamilton-Jacobi equations on a network: application to...
Numerical approach for Hamilton-Jacobi equations on a network: application to...
 
Tensorizing Neural Network
Tensorizing Neural NetworkTensorizing Neural Network
Tensorizing Neural Network
 
CSC446: Pattern Recognition (LN6)
CSC446: Pattern Recognition (LN6)CSC446: Pattern Recognition (LN6)
CSC446: Pattern Recognition (LN6)
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice Cryptography
 
Cyclic code systematic
Cyclic code systematicCyclic code systematic
Cyclic code systematic
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
 
Parallel Optimization in Machine Learning
Parallel Optimization in Machine LearningParallel Optimization in Machine Learning
Parallel Optimization in Machine Learning
 
Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)Java and Deep Learning (Introduction)
Java and Deep Learning (Introduction)
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Graph Kernels for Chemical Informatics
Graph Kernels for Chemical InformaticsGraph Kernels for Chemical Informatics
Graph Kernels for Chemical Informatics
 
Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Vision
 
Random Forest for Big Data
Random Forest for Big DataRandom Forest for Big Data
Random Forest for Big Data
 
Eight Formalisms for Defining Graph Models
Eight Formalisms for Defining Graph ModelsEight Formalisms for Defining Graph Models
Eight Formalisms for Defining Graph Models
 
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMS
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMSON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMS
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMS
 

Similar to Swapping ball - Nguyễn Đình Nhật - Nguyễn Như Hải Triều

AnswerThe new program with the required constructor and with a te.pdf
AnswerThe new program with the required constructor and with a te.pdfAnswerThe new program with the required constructor and with a te.pdf
AnswerThe new program with the required constructor and with a te.pdfnipuns1983
 
linkedlist-130914084342-phpapp02.pptx
linkedlist-130914084342-phpapp02.pptxlinkedlist-130914084342-phpapp02.pptx
linkedlist-130914084342-phpapp02.pptxMeghaKulkarni27
 
COMP2710: Software Construction - Linked list exercises
COMP2710: Software Construction - Linked list exercisesCOMP2710: Software Construction - Linked list exercises
COMP2710: Software Construction - Linked list exercisesXiao Qin
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxkarlynwih
 
Lab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docxLab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docxteyaj1
 
Write code in c++ Program to a topological sort on a graph Program pl.docx
Write code in c++ Program to a topological sort on a graph  Program pl.docxWrite code in c++ Program to a topological sort on a graph  Program pl.docx
Write code in c++ Program to a topological sort on a graph Program pl.docxnoreendchesterton753
 
In the class we extensively discussed a node class called IntNode in.pdf
In the class we extensively discussed a node class called IntNode in.pdfIn the class we extensively discussed a node class called IntNode in.pdf
In the class we extensively discussed a node class called IntNode in.pdfarjunstores123
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYMalikireddy Bramhananda Reddy
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfEricvtJFraserr
 
#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docxajoy21
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfpoblettesedanoree498
 
Use C++class Node{public   Node ( int = 0 );       constru.pdf
Use C++class Node{public   Node ( int = 0 );        constru.pdfUse C++class Node{public   Node ( int = 0 );        constru.pdf
Use C++class Node{public   Node ( int = 0 );       constru.pdfoptokunal1
 
#include iostream using namespace std; const int nil = 0; cl.docx
#include iostream using namespace std; const int nil = 0; cl.docx#include iostream using namespace std; const int nil = 0; cl.docx
#include iostream using namespace std; const int nil = 0; cl.docxajoy21
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptxKokilaK25
 

Similar to Swapping ball - Nguyễn Đình Nhật - Nguyễn Như Hải Triều (20)

AnswerThe new program with the required constructor and with a te.pdf
AnswerThe new program with the required constructor and with a te.pdfAnswerThe new program with the required constructor and with a te.pdf
AnswerThe new program with the required constructor and with a te.pdf
 
Link list
Link listLink list
Link list
 
linkedlist-130914084342-phpapp02.pptx
linkedlist-130914084342-phpapp02.pptxlinkedlist-130914084342-phpapp02.pptx
linkedlist-130914084342-phpapp02.pptx
 
COMP2710: Software Construction - Linked list exercises
COMP2710: Software Construction - Linked list exercisesCOMP2710: Software Construction - Linked list exercises
COMP2710: Software Construction - Linked list exercises
 
Linked list
Linked listLinked list
Linked list
 
Dsprograms(2nd cse)
Dsprograms(2nd cse)Dsprograms(2nd cse)
Dsprograms(2nd cse)
 
DSA(1).pptx
DSA(1).pptxDSA(1).pptx
DSA(1).pptx
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docx
 
Lab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docxLab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docx
 
Write code in c++ Program to a topological sort on a graph Program pl.docx
Write code in c++ Program to a topological sort on a graph  Program pl.docxWrite code in c++ Program to a topological sort on a graph  Program pl.docx
Write code in c++ Program to a topological sort on a graph Program pl.docx
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
 
In the class we extensively discussed a node class called IntNode in.pdf
In the class we extensively discussed a node class called IntNode in.pdfIn the class we extensively discussed a node class called IntNode in.pdf
In the class we extensively discussed a node class called IntNode in.pdf
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
 
Use C++class Node{public   Node ( int = 0 );       constru.pdf
Use C++class Node{public   Node ( int = 0 );        constru.pdfUse C++class Node{public   Node ( int = 0 );        constru.pdf
Use C++class Node{public   Node ( int = 0 );       constru.pdf
 
Lab-2.4 101.pdf
Lab-2.4 101.pdfLab-2.4 101.pdf
Lab-2.4 101.pdf
 
#include iostream using namespace std; const int nil = 0; cl.docx
#include iostream using namespace std; const int nil = 0; cl.docx#include iostream using namespace std; const int nil = 0; cl.docx
#include iostream using namespace std; const int nil = 0; cl.docx
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 

More from mrcoffee282

Conflict Resolution Skill - Teamwork Team 1 - K15CMU-TCD1
Conflict Resolution Skill - Teamwork  Team 1 - K15CMU-TCD1Conflict Resolution Skill - Teamwork  Team 1 - K15CMU-TCD1
Conflict Resolution Skill - Teamwork Team 1 - K15CMU-TCD1mrcoffee282
 
Bai tap tham khao CSPE
Bai tap tham khao CSPEBai tap tham khao CSPE
Bai tap tham khao CSPEmrcoffee282
 
Database Project 2011
Database Project 2011Database Project 2011
Database Project 2011mrcoffee282
 
Database Project 2011
Database Project 2011Database Project 2011
Database Project 2011mrcoffee282
 
Ôn tập KTTMDT
Ôn tập KTTMDTÔn tập KTTMDT
Ôn tập KTTMDTmrcoffee282
 

More from mrcoffee282 (6)

Conflict Resolution Skill - Teamwork Team 1 - K15CMU-TCD1
Conflict Resolution Skill - Teamwork  Team 1 - K15CMU-TCD1Conflict Resolution Skill - Teamwork  Team 1 - K15CMU-TCD1
Conflict Resolution Skill - Teamwork Team 1 - K15CMU-TCD1
 
My Hash
My HashMy Hash
My Hash
 
Bai tap tham khao CSPE
Bai tap tham khao CSPEBai tap tham khao CSPE
Bai tap tham khao CSPE
 
Database Project 2011
Database Project 2011Database Project 2011
Database Project 2011
 
Database Project 2011
Database Project 2011Database Project 2011
Database Project 2011
 
Ôn tập KTTMDT
Ôn tập KTTMDTÔn tập KTTMDT
Ôn tập KTTMDT
 

Recently uploaded

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 

Recently uploaded (20)

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 

Swapping ball - Nguyễn Đình Nhật - Nguyễn Như Hải Triều

  • 1. Computer Science for Practicing Engineering DUY TAN UNIVERSITY DUY TAN UNIVERSITY INTERNATIONAL SCHOOL ASSIGNMENT Computer Science for Practicing Engineering ********** Faculty: HUỲNH BÁ DIỆU Student's name: NGUYỄN ĐÌNH NHẬT NGUYỄN NHƯ HẢI TRIỀU Class: K15CMU-TCD1 Da Nang, 28/05/2011 Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 1 of 14
  • 2. Computer Science for Practicing Engineering DUY TAN UNIVERSITY ASSIGNMENT Reqest: Swap N number of blue balls and red ball. Example: Enter N is 3. Total ball: 3 red balls + 3 blue balls = 6 balls Total cells: 6 balls + 1 empty = 7 cells Describe project: In this project, we use Double Link List to keep balls. We use Node to keep information. Information of Node include Data (Red, Blue or Empty), Next ( Next Node), and Previous (Previous Node). Additionally, We use HEAD node and TAIL node to define the first node and the last node. Describe the way of sort: Enter any N “number”. We create Double Link List to include 2*N+1 Node. It incude N red balls, N blue balls and 1 Empty Node. Move by one blue ball from left to right. Then move the box from right to left (blue ball next to last). Continue to moving all blue ball to the right. Move the empty cell into position between red and green balls. However, in this algorithm, we have two case to comeback. If N is even number or N is odd number. With N is even number, we swap empty cell for pre-pre-emptycell, and continue to moving Blue ball to an adjacent empty square. With N is odd number, we use a nother way. We need two steps to move the ball on the desired location. Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 2 of 14
  • 3. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Describe algorithm: Create Node: Node Describe Type Data Red, Blue or Empty Char Next Next Node Node Prev Previous Node Node Enter N number: 2 Create Double Link List: Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 3 of 14
  • 4. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Describe algorithm by chart Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 4 of 14
  • 5. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Describe algorithm by Pseudocode int checkList = 0; while(checkList!=n) nodeRef = Head; while(nodeRef.next.data!='*') nodeRef = nodeRef.next; recheck condition. // nodeRef == REDball while (REDball != Tail && Next-REDball == EMPTYcell) change REDball for EMPTYcell in the next. if(REDball !=Tail && Next-REDball == BLUEball) change EMPTYcell (behind REDball) for BLUEball (in front of it); if(++checkList==n) Finish algorithm and print result. nullNode = nodeRef.prew; // nodeRef ==EMPTYcell while (Prev-EMPTYcell != BLUEball && Prev-EMPTYcell != Head) if ( Prev-Prev-EMPTYcell != BLUEball) change EMPTYcell for Prev-Prev-EMPTYcell. else change EMPTYcell for Prev-Prev-EMPTYcell. change EMPTYcell for Next-EMPTYcell change EMPTYcell for Next-Next-EMPTYcell Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 5 of 14
  • 6. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Describe by model With N = 2 (even number) Total steps: 11 Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 6 of 14
  • 7. Computer Science for Practicing Engineering DUY TAN UNIVERSITY With N = 3 (odd number) Total steps: 21 Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 7 of 14
  • 8. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 8 of 14
  • 9. Computer Science for Practicing Engineering DUY TAN UNIVERSITY CODE: LinkList class /* * Object: Computer Science for Practicing Engineering * Faculty Huynh Ba Dieu * Authors: * 1. Nguyen Dinh Nhat * 2. Nguyen Nhu Hai Trieu * Class: K15CMU-TCD1 -- International School -- Duy Tan University * 05/2011 */ import java.util.*; public class LinkList { // Node class class Node { char data; Node next,prew; //Method: create a node Node(char x) { data=x; next=prew=null; } Node(char x, Node t) { data = x; next = prew = null; if(t!=null) { next = t; t.prew = this; } } } Node Head, Tail; Node nullNode; Node nodeRef; static int count=0; static int n; //Method: create null Link List LinkList(){ Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 9 of 14
  • 10. Computer Science for Practicing Engineering DUY TAN UNIVERSITY Head=Tail=null; } //Method: create Link Link with data void createLinkList() { char x = 'B'; for(int i=1;i<=2*n+1;i++) { if(i<n+1)x='B'; else if(i==n+1)x='*'; else x='R'; Node t = new Node(x,null); if(Head==null) Head=Tail=t; else { Tail.next = t; t.prew = Tail; Tail = t;} } } //Method: display LinkList from HEAD to TAIL void display() { Node p = Head; System.out.print("| "); while(p!=null) { System.out.print(p.data + " | "); p = p.next; } System.out.println(""); } //Method: display LinkList from TAIL to HEAD void display2() { Node p = Tail; System.out.print("| "); while(p!=null) { System.out.print(p.data + " | "); p = p.prew; } System.out.println(""); } //Method: swap ball void changeBall() { int checkList = 0; while(checkList!=n){ nodeRef = Head; Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 10 of 14
  • 11. Computer Science for Practicing Engineering DUY TAN UNIVERSITY while(nodeRef.next.data!='*') { nodeRef = nodeRef.next; } while(nodeRef!=Tail && nodeRef.next.data=='*'){ this.change2Ball(nodeRef, nodeRef.next); if(nodeRef!=Tail && nodeRef.next.data=='R') { this.change3Ball(nodeRef.prew, nodeRef, nodeRef.next); } } if(++checkList==n) return; nullNode = nodeRef.prew; while(nullNode.prew.data!='B' && nullNode.prew!=Head){ if(nullNode.prew.prew.data!='B') this.change3Ball(nullNode.prew.prew, nullNode.prew, nullNode); else { this.change3Ball(nullNode.prew.prew, nullNode.prew, nullNode); this.change2Ball(nullNode, nullNode.next); this.change3Ball(nullNode, nullNode.next, nullNode.next.next); } } } } //Sub method void display3(){ count++; System.out.print(" " + count + " times:t"); this.display(); } //Method: move a ball to an adjacent empty square (forwards or backwards) void change2Ball(Node a, Node b) { if(a.prew!=null && b.next!=null){ b.next.prew = a; a.prew.next = b; a.next = b.next; b.prew = a.prew; b.next = a; a.prew = b; } else if(a == Head){ Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 11 of 14
  • 12. Computer Science for Practicing Engineering DUY TAN UNIVERSITY b.prew = null; b.next.prew = a; a.next = b.next; b.next = a; a.prew = b; Head = b; } else if(b == Tail){ a.next = null; a.prew.next = b; b.prew = a.prew; b.next = a; a.prew = b; Tail = a; } this.display3(); } //Method: jump a single adjacent ball into an empty square (forwards or backwards) void change3Ball(Node a, Node b, Node c) { if(a == Head && c == Tail){ a.next = null; a.prew = b; c.next = b; c.prew = null; b.next = a; b.prew = c; Head = c; Tail = a; } else if(c.next!=null && a.prew!=null){ c.next.prew = a; c.prew = a.prew; a.prew.next = c; a.next = c.next; a.prew = b; b.prew = c; c.next = b; b.next = a; } else if(a == Head){ c.next.prew = a; a.prew = b; Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 12 of 14
  • 13. Computer Science for Practicing Engineering DUY TAN UNIVERSITY b.prew = c; c.prew = null; a.next = c.next; b.next = a; c.next = b; Head = c; } else if(c == Tail){ a.prew.next = c; c.next = b; b.next = a; a.next = null; c.prew = a.prew; b.prew = c; a.prew = b; Tail = a; } this.display3(); } //Main method public static void main (String [] ndnhat){ LinkList ll = new LinkList(); Scanner kb = new Scanner(System.in); System.out.println(" ********* Final-Project: Swap Ball ********"); System.out.print(" Enter N: "); n = kb.nextInt(); ll.createLinkList(); System.out.print(" LinkList :t"); ll.display(); System.out.println("n"); ll.changeBall(); System.out.println(""); System.out.print(" LinkList :t"); ll.display(); System.out.println(" Total times of swap: "+count); } } Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 13 of 14
  • 14. Computer Science for Practicing Engineering DUY TAN UNIVERSITY RESULT Authors: Nguyễn Đình Nhật – Nguyễn Như Hải Triều --- Class: K15CMU-TCD1 Page 14 of 14