• Kĩ thuật lập trình - Các giải thuật tìm kiếm, sắp xếpKĩ thuật lập trình - Các giải thuật tìm kiếm, sắp xếp

    Cấu trúc liên kết vs. cấu trúc liên tục 1. Cấu trúc liên tục yêu cầu ít bộ nhớ máy tính, thời gian và công việc lập trình khi các phần tử trong cấu trúc là nhỏ và giải thuật đơn giản ngược lại, cấu trúc liên kết sẽ tiết kiệm hơn 2. Sử dụng con trỏ và cơ chế cấp phát bộ nhớ động cho phép chương trình thích hợp với các ứng dụng có kích thước...

    pdf98 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1374 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 15: Recursive algorithmsTài liệu Môn học phương pháp lập trình - Chapter 15: Recursive algorithms

    In general, use recursion if A recursive solution is natural and easy to understand. A recursive solution does not result in excessive duplicate computation. The equivalent iterative solution is too complex.

    ppt19 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1245 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 14: Gui and event - Driven programmingTài liệu Môn học phương pháp lập trình - Chapter 14: Gui and event - Driven programming

    Mouse events include such user interactions as moving the mouse dragging the mouse (moving the mouse while the mouse button is being pressed) clicking the mouse buttons. The MouseListener interface handles mouse button mouseClicked, mouseEntered, mouseExited, mousePressed, and mouseReleased The MouseMotionListener interface handles mouse mov...

    ppt49 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1224 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 13: inheritance and polymorphismTài liệu Môn học phương pháp lập trình - Chapter 13: inheritance and polymorphism

    We finalize the program by correcting any remaining errors, inconsistency, or unfinished methods. We want to review the methods and improve them as necessarily. One problem (which would have been identified in step 4 testing) we need to correct is the missing method for expanding the roster array when the input file includes more student entries ...

    ppt45 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1274 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 12: File input and outputTài liệu Môn học phương pháp lập trình - Chapter 12: File input and output

    We will write a test program to verify that the data can be read back correctly from a file. To test the read operation, the file to read the data from must already exist. We will make this test program save the data first by using the TestAddressBookWrite class from .

    ppt37 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1161 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 11: Sorting and searchingTài liệu Môn học phương pháp lập trình - Chapter 11: Sorting and searching

    In the previous two versions, we used an array data structure to maintain a collection of Person objects In the third version, we don't use an array at all. Instead, we use a Map from the Java Collection Framework to maintain a collection of Person objects. We use the person's name as the key of a Map entry and the person object as the value of ...

    ppt58 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1197 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 10: Arrays and collectionsTài liệu Môn học phương pháp lập trình - Chapter 10: Arrays and collections

    Final Test Since the three operations of add, delete, and search are interrelated, it is critical to test these operations together. We try out various combinations of add, delete, and search operations. Possible Extensions One very useful extension is scanning. Scanning is an operation to visit all elements in the collection. Scanning is usef...

    ppt60 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1338 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 9: Characters and stringsTài liệu Môn học phương pháp lập trình - Chapter 9: Characters and strings

    Possible Extensions One is an integrated user interface where the end user can view both the input document files and the output word list files. Another is the generation of different types of list. In the sample development, we count the number of occurences of each word. Instead, we can generate a list of positions where each word appears in ...

    ppt42 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1306 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 8: Exceptions and assertionsTài liệu Môn học phương pháp lập trình - Chapter 8: Exceptions and assertions

    The purpose of Step 2 testing is to verify the correct behavior of an InputHandler. We need to test both successful and unsuccessful cases. We must verify that the door is in fact opened when the valid information is entered. We must also verify that the error message is displayed when there’s an error in input. We should test invalid cases...

    ppt41 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1212 | Lượt tải: 0

  • Tài liệu Môn học phương pháp lập trình - Chapter 7: Defining your own classes part 2Tài liệu Môn học phương pháp lập trình - Chapter 7: Defining your own classes part 2

    Program Review Are all the possible cases handled? Are the input routines easy to use? Will it be better if we allow different formats for entering the date information? Possible Extensions Warn the user, say, by popping a warning window or ringing an alarm, when the due date is approaching. Provide a special form window to enter data (No...

    ppt46 trang | Chia sẻ: nguyenlam99 | Ngày: 04/01/2019 | Lượt xem: 1180 | Lượt tải: 0