Part-1greatest common divisor show a recursive

Assignment Help Data Structure & Algorithms
Reference no: EM13346856

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.

Reference no: EM13346856

Questions Cloud

This sample webpages aim is to will serve most of the : this sample webpages aim is to will serve most of the audience including elder people and people with disabilities. it
1 in john stossels article in praise of price gouging : 1. in john stossels article in praise of price gouging stossel argues that a law banning price gouging would result in
Write paper on inventory management systemreport : write paper on inventory management system.report containsabstractacknowledgementintroductionmotivation for the project
Corporate financewrite paper on financial analysis and : corporate financewrite paper on financial analysis and business analysis of cott corporation. financial analysis as it
Part-1greatest common divisor show a recursive : part-1greatest common divisor show a recursive implementation of euclids algorithm for finding the greatest common
1 introductionexplain the purpose of the studyii summary of : 1. introductionexplain the purpose of the study.ii. summary of data collectionidentify sample population sampling frame
Design a dynamic database using mangodb html and php : design a dynamic database using mangodb html and php. database should be designed to have the subsequent static
Socket programming in java tcpgoal in this project we will : socket programming in java tcpgoal in this project we will develop a web server in two steps. in the end you will have
Designing and developing a web applications the company you : designing and developing a web applications the company you are working has secured a contract with a local banking

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Create a shell script to locate executable files

Create a shell script to locate executable documents? The script takes a list of document names from the command line and determines which would be executed had these names been given as commands.

  Question related to ms excel

Discuss how do I insert a row in multiple tables on different sheets in the same workbook? I have twelve sheets, one for every month, and the sheets are exactly the same.

  Write a c++ program to find the intersection

Write a C++ program to find the intersection, A set is a collection of distinct entities regarded as a unit, being either individually specified or (more usually) satisfying specified conditions.

  Write algorithm which divides n objects of u into k clusters

Suggest the algorithm which divides n objects of U into k clusters, making use of MST of a graph. Give a simple argument of correctness and bound on the running time of the algorithm you are proposing.

  Find minimum number of storage required for bfs and dfs

Assume we have problem space where there is uniform branching factor b and there is single goal node at depth m. Determine the minimum number of nodes expanded and storage required for BFS and DFS?

  Create a work plan

Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer. Describe the recurrence relation used by your algorithm at the top of your program or in a separate f..

  Diameter bounded minimum spanning tree of graph by prim-s

Modify Prim's or Kruskal's algorithm to determine diameter bounded minimum spanning tree of complete graph. A diameter bounded minimum spanning tree is spanning tree.

  Use big-o notation to categorize algorithms

Use big-O notation to categorize traditional grade school algorithms for addition and multiplication. That is, if asked to add two numbers each having N digits, determine individual additions should be performed?

  Currency conversion developmentapplication-level

currency conversion developmentapplication-level requirements list1. the program will prompt the user for data input of

  The class linked bag did not have the data member itemcount

the class LinkedBag did not have the data member itemCount. Revise the method getCurrentSize so that it counts the number of nodes in the linked chain

  Explain two possible solution-fill in blank squares by words

The objective is to fill in blank squares using words from the list. Your task is to formulate problem as constraint satisfaction problem. Explain two possible solutions.

  Finding the values of queuefront and queuerear

Assume that queue is a queue type object and the size of the array-implementing queue is 100. Also, assume that the value of the queueFront is 25 and the value of queueRear is twenty-five.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd