Introduction To Algorithms, Third Edition (international Edition)
3rd Edition
ISBN: 9780262533058
Author: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein
Publisher: TRILITERAL
expand_more
expand_more
format_list_bulleted
Question
Chapter 33, Problem 3P
(a)
Program Plan Intro
To describe the way to find a line in
(b)
Program Plan Intro
Toprovide an
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
EX:[AE00]=fa50h number of ones =1111 1010 0101 0000
Physical address=4AE00h=4000h*10h+AE00h
Mov ax,4000
Mov ds,ax; DS=4000h
mov ds,4000 X
Mov ax,[AE00] ; ax=[ae00]=FA50h
Mov cx,10; 16 bit in decimal
Mov bl,0
*: Ror ax,1
Jnc **
Inc bl
**:Dec cx
Jnz *
;LSB⇒CF
Cf=1
; it jump when CF=0, will not jump when CF=1
HW1: rewrite the above example use another way
EX2: Write a piece of assembly code that can count the number of
ones in word stored at 4AE00h
Write a program that simulates a Magic 8 Ball, which is a fortune-telling toy that displays a random response to a yes or no question. In the student sample programs for this book, you will find a text file named 8_ball_responses.txt. The file contains 12 responses, such as “I don’t think so”, “Yes, of course!”, “I’m not sure”, and so forth. The program should read the responses from the file into a list. It should prompt the user to ask a question, then display one of the responses, randomly selected from the list. The program should repeat until the user is ready to quit.
Contents of 8_ball_responses.txt:
Yes, of course! Without a doubt, yes. You can count on it. For sure! Ask me later. I'm not sure. I can't tell you right now. I'll tell you after my nap. No way! I don't think so. Without a doubt, no. The answer is clearly NO.
(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
Chapter 33 Solutions
Introduction To Algorithms, Third Edition (international Edition)
Ch. 33.1 - Prob. 1ECh. 33.1 - Prob. 2ECh. 33.1 - Prob. 3ECh. 33.1 - Prob. 4ECh. 33.1 - Prob. 5ECh. 33.1 - Prob. 6ECh. 33.1 - Prob. 7ECh. 33.1 - Prob. 8ECh. 33.2 - Prob. 1ECh. 33.2 - Prob. 2E
Ch. 33.2 - Prob. 3ECh. 33.2 - Prob. 4ECh. 33.2 - Prob. 5ECh. 33.2 - Prob. 6ECh. 33.2 - Prob. 7ECh. 33.2 - Prob. 8ECh. 33.2 - Prob. 9ECh. 33.3 - Prob. 1ECh. 33.3 - Prob. 2ECh. 33.3 - Prob. 3ECh. 33.3 - Prob. 4ECh. 33.3 - Prob. 5ECh. 33.3 - Prob. 6ECh. 33.4 - Prob. 1ECh. 33.4 - Prob. 2ECh. 33.4 - Prob. 3ECh. 33.4 - Prob. 4ECh. 33.4 - Prob. 5ECh. 33.4 - Prob. 6ECh. 33 - Prob. 1PCh. 33 - Prob. 2PCh. 33 - Prob. 3PCh. 33 - Prob. 4PCh. 33 - Prob. 5P
Knowledge Booster
Similar questions
- I need help creating the network diagram and then revising it for the modified activity times.arrow_forwardActivity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.arrow_forwardGiven the following Extended-BNF grammar of the basic mathematical expressions: Show the derivation steps for the expression: ( 2 + 3 ) * 6 – 20 / ( 3 + 1 ) Draw the parsing tree of this expression. SEE IMAGEarrow_forward
- Whentheuserenters!!,themostrecentcommandinthehistoryisexecuted.In the example above, if the user entered the command: Osh> !! The ‘ls -l’ command should be executed and echoed on user’s screen. The command should also be placed in the history buffer as the next command. Whentheuserentersasingle!followedbyanintegerN,theNthcommandin the history is executed. In the example above, if the user entered the command: Osh> ! 3 The ‘ps’ command should be executed and echoed on the user’s screen. The command should also be placed in the history buffer as the next command. Error handling: The program should also manage basic error handling. For example, if there are no commands in the history, entering !! should result in a message “No commands in history.” Also, if there is no command corresponding to the number entered with the single !, the program should output "No such command in history."arrow_forwardActivity No. Activity Time (weeks) Immediate Predecessors 1 Requirements collection 3 2 Requirements structuring 4 1 3 Process analysis 3 2 4 Data analysis 3 2 5 Logical design 50 3,4 6 Physical design 5 5 7 Implementation 6 6 c. Using the information from part b, prepare a network diagram. Identify the critical path.arrow_forward2. UNIX Shell and History Feature [20 points] This question consists of designing a C program to serve as a shell interface that accepts user commands and then executes each command in a separate process. A shell interface gives the user a prompt, after which the next command is entered. The example below illustrates the prompt osh> and the user's next command: cat prog.c. The UNIX/Linux cat command displays the contents of the file prog.c on the terminal using the UNIX/Linux cat command and your program needs to do the same. osh> cat prog.c The above can be achieved by running your shell interface as a parent process. Every time a command is entered, you create a child process by using fork(), which then executes the user's command using one of the system calls in the exec() family (as described in Chapter 3). A C program that provides the general operations of a command-line shell can be seen below. #include #include #define MAX LINE 80 /* The maximum length command */ { int…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrLINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE LProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage