TAILIEUCHUNG - Data Structures and Program Design in C++ phần 10

Trong cả hai trường hợp, các nút với phím mục tiêu kết thúc lên như là gốc của cây. Chúng ta sẽ thực hiện các cây xoay ra ngoài như là một lớp có nguồn gốc từ các Search_tree lớp do đó, ngoài các phương pháp xoay ra ngoài đặc biệt, tất cả các phương pháp thông thường Search_tree có thể được áp dụng để xoay ra ngoài cây. Các đặc điểm kỹ thuật lớp sau: | Section An Interactive Expression Evaluator 641 data members in the Plot constructor. We would for example give them the values 19 and 79 to obtain a 20 X 80 text screen or perhaps 780 and 1024 for a graphics screen. A position on the screen is specified by giving its integer row and column coordinates from the ranges 0 row max_row and 0 col max_col. The method get_print_row uses the y-coordinate of a point of our graph to calculate a corresponding row of the screen. int Plot get_print_row double y_value Post Returns the row of the screen at which a point with y-coordinate y_value should be plotted or returns -1 if the point would fall off the edge of the screen. double interp_y double max_row y_high - y_value y_high - y_low int answer int interp_y if answer 0 11 answer max_row answer -1 return answer The function returns a value of - 1 to signify an input coordinate from outside the limits of the graph. 2. Points The Sortable_list in a Plot stores objects of the class Point. Since these objects represent data points to be plotted each Point must include two integer data members row and col that determine a location on the user s screen. These data members completely determine the ordering of points. We can therefore simply view a Point as its own sorting key. In our program this decision is implemented with the definition typedef Point Key To ensure compatibility with our earlier sorting methods each Point must have overloaded comparison operators. The Point structure that we now define also includes two constructors. The constructors create either a Point with no useable data or a Point storing the given row and col parameter values. struct Point int row int col Point Point int a int b bool operator bool operator bool operator bool operator bool operator bool operator const Point p const Point p const Point p const Point p const Point p const Point p 642 Chapter 13 Case Study The Polish Notation Eventually when we plot data to the screen we will first .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.