intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

CSE Faculty - Chapter 3: STACK (part b)

Chia sẻ: Trương Thanh Long | Ngày: | Loại File: PDF | Số trang:37

54
lượt xem
2
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Reversing data items Ex.: Reverse a list. Convert Decimal to Binary. Brackets Parse. Infix to Postfix Transformation. Evaluate a Postfix Expression. Parsing Ex.: Ex.: Postponement of processing data items Backtracking Ex.: Goal Seeking Problem. Knight’s Tour. Exiting a Maze. Eight Queens Problem. .Reverse a list PROBLEM: Read n numbers, print the list in reverse order. Algorithm ReverseList Pre User supplies numbers. Post The numbers are printed in reverse order. Uses Stack ADT. 1. loop (stack is not full and there is more number) 1. read a number 2. push the number into the stack 2. loop (stack is not empty) 1. top the number from the stack 2. pop...

Chủ đề:
Lưu

Nội dung Text: CSE Faculty - Chapter 3: STACK (part b)

ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2