Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

Part-1

Greatest Common Divisor: Show a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers. Descriptions of this algorithm are shown in algebra books and on the Web. (Note: A nonrecursive version of the GCD problem was provided in the programming exercises.) Show a test program that calls your GCD procedure five times, using the subsequent pairs of integers: (5,20), (24,18), (11,7), (432,226), (26,13). After each procedure call, display the GCD.

Part-2

. Str_concat Procedure

Write a procedure named Str_concat that concatenates a source string to the end of a target string. Sufficient space must exist in the target string to accommodate the new characters. Pass pointers to the target and source strings. Here is a sample call:

.data

targetStr BYTE "ABCDE",10 DUP(0)

sourceStr BYTE "FGH",0

.code

INVOKE Str_concat, ADDR targetStr, ADDR sourceStr

Part-3

mWritestringAttr Macro

Prepare a macro that writes a null-terminated string to the console with a given text color. The macro parameters could include the string name and the color. Hint: Call SetTextColor from the book's link library. Write a program that tests your macro with various strings in different colors. Sample call:

.data

myStringdb "Here is my string",0

.code

mWritestringmyString, white

File Allocation Table (FAT) The FAT12, FAT16, and FAT32 file systems use a table called the file allocation table (FAT) to keep track of each file's location on the disk. The FAT maps the disk clusters, showing their ownership by specific files. Each entry corresponds to a cluster number, and each cluster contains one or more sectors. In other words, the 10th FAT entry identifies the 10th cluster on the disk, the 11th entry identifies the 11th cluster, and so on. Each file is represented in the FAT as a linked list, called a cluster chain . Each FAT entry contains an integer that identifies the next entry. Two cluster chains are shown in Figure 15-14, one for File1 and the other for File2 . File1 occupies clusters 1, 2, 3, 4, 8, 9, and 10. File2 occupies clusters 5, 6, 7, 11, and 12. The eoc( end of chain ) marker in the last FAT entry for a file is a predefined integer value marking the final cluster in the chain.

When a file is created, the operating system looks for the first available cluster entry in the FAT. Gaps occur when not enough contiguous clusters are available to hold the entire file. In the preceding diagram, this happened to both File1 and File2 . When a file is modified and saved back to disk, its cluster chain often becomes increasingly fragmented. If many files become fragmented, the disk's performance begins to degrade because the read/write heads must jump between different tracks to locate all of a file's clusters. Most operating systems supply a built-in disk defragmentation utility. Figure 15-14 Example: Two Cluster Chains. File1: starting cluster number 1, size 7 clusters 2348 12 9 10 eoc 3456 7 8 File2: starting cluster number 5, size 9 10 1112 13 14 15 16 5 clusters 6711 12 3456 7 8 15.3.4 Section Review 12 eoc 9 10 1112 13 14 15 16

Part-4

String Input/Output

Write a program that inputs the subsequent information from the user, using the Win32 ReadConsole function: first name, last name, age, phone number. Display the same information with labels and attractive formatting, using the Win32 WriteConsole function. Do not use any procedures from the Irvine32 library.

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M9716473
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Data Structure

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As