Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 8.3, Problem 3QE
Program Plan Intro

Address polynomial for converting references in terms of row and column positions into memory addresses:

  • Finding the address of entry in ith row and jth column using the below formula

x+(c×(i-1))+(j-1)

  • From the given expression, “(c×(i-1))+(j-1)” is called as address polynomial.
  • From the above formula, “c” denotes the number of columns in given array.
  • Then “x” denotes the address of the cell containing the entry in the first row and first column.
    • That is, user must move above “i – 1” rows, each of which contains “c” entries, to reach ith row and then “j – 1” more entries to reach the jth entry in this row.

Example:

The example for finding the address polynomial is shown below:

  • Assume, the number of column in an array is “5” that is “c = 5” and “i = 2” and “j = 3”.
  • Hence if the array were stored beginning at address “x”, then entry in the second row, third column would be at address

 = x+(5×(2-1))+(3-1)=x+(5×1)+ 2=x+5 + 2= x + 7

  • Therefore, to reach the entry in the second row and third column, user must move above “7” entries from the beginning of the block.

Blurred answer
Students have asked these similar questions
Computer Science A two-dimensional array of type int is defined in C using the same structure as a two-dimensional array in Java. If the dimensions are defined as 20 rows by 10 columns, what is the largest contiguous block of memory required by this array? Assume that the machine in question has an address size of 64-bits.
How difficult is it to duplicate a collection of shared pointers into another array while using the C++ programming language? Create a list of the several approaches you may use to tackle the issue that has been presented to you. Is it the case that copying a shared pointer also copies the objects that it controls? Explain
c programming language The program below uses pointer arithmetic to determine the size of a 'char'variable. By using pointer arithmetic we can find out the value of 'cp' and thevalue of 'cp+1'. Since cp is a pointer, this addition involves pointer arithmetic:adding one to a pointer makes the pointer point to the next element of the sametype.For a pointer to a char, adding 1 really just means adding 1 to the address, butthis is only because each char is 1 byte.1. Compile and run the program and see what it does.2. Write some code that does pointer arithmetic with a pointer to an int anddetermine how big an int is.3. Same idea – figure out how big a double is, by using pointer arithmetic andprinting out the value of the pointer before and after adding 1.4. What should happen if you added 2 to the pointers from exercises 1through 3, instead of 1? Use your program to verify your answer.#include <stdio.h>int main( ){ char c = 'Z'; char *cp = &c; printf("cp is %p\n", cp);…

Chapter 8 Solutions

Computer Science: An Overview (13th Edition) (What's New in Computer Science)

Ch. 8.3 - Prob. 3QECh. 8.3 - Prob. 4QECh. 8.3 - Modify the function in Figure 8.19 so that it...Ch. 8.3 - Prob. 7QECh. 8.3 - Prob. 8QECh. 8.3 - Draw a diagram representing how the tree below...Ch. 8.4 - Prob. 1QECh. 8.4 - Prob. 2QECh. 8.4 - Prob. 3QECh. 8.4 - Prob. 4QECh. 8.5 - Prob. 1QECh. 8.5 - Prob. 3QECh. 8.5 - Prob. 4QECh. 8.6 - In what ways are abstract data types and classes...Ch. 8.6 - What is the difference between a class and an...Ch. 8.6 - Prob. 3QECh. 8.7 - Suppose the Vole machine language (Appendix C) has...Ch. 8.7 - Prob. 2QECh. 8.7 - Using the extensions described at the end of this...Ch. 8.7 - In the chapter, we introduced a machine...Ch. 8 - Prob. 1CRPCh. 8 - Prob. 2CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 4CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 6CRPCh. 8 - Prob. 7CRPCh. 8 - Prob. 8CRPCh. 8 - Prob. 9CRPCh. 8 - Prob. 10CRPCh. 8 - Prob. 11CRPCh. 8 - Prob. 12CRPCh. 8 - Prob. 13CRPCh. 8 - Prob. 14CRPCh. 8 - Prob. 15CRPCh. 8 - Prob. 16CRPCh. 8 - Prob. 17CRPCh. 8 - Prob. 18CRPCh. 8 - Design a function to compare the contents of two...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 22CRPCh. 8 - Prob. 23CRPCh. 8 - Prob. 24CRPCh. 8 - (Asterisked problems are associated with optional...Ch. 8 - Prob. 26CRPCh. 8 - Prob. 27CRPCh. 8 - Prob. 28CRPCh. 8 - Prob. 29CRPCh. 8 - Prob. 30CRPCh. 8 - Design a nonrecursive algorithm to replace the...Ch. 8 - Prob. 32CRPCh. 8 - Prob. 33CRPCh. 8 - Prob. 34CRPCh. 8 - Draw a diagram showing how the binary tree below...Ch. 8 - Prob. 36CRPCh. 8 - Prob. 37CRPCh. 8 - Prob. 38CRPCh. 8 - Prob. 39CRPCh. 8 - Prob. 40CRPCh. 8 - Modify the function in Figure 8.24 print the list...Ch. 8 - Prob. 42CRPCh. 8 - Prob. 43CRPCh. 8 - Prob. 44CRPCh. 8 - Prob. 45CRPCh. 8 - Prob. 46CRPCh. 8 - Using pseudocode similar to the Java class syntax...Ch. 8 - Prob. 48CRPCh. 8 - Identify the data structures and procedures that...Ch. 8 - Prob. 51CRPCh. 8 - In what way is a class more general than a...Ch. 8 - Prob. 53CRPCh. 8 - Prob. 54CRPCh. 8 - Prob. 55CRPCh. 8 - Prob. 1SICh. 8 - Prob. 2SICh. 8 - In many application programs, the size to which a...Ch. 8 - Prob. 4SICh. 8 - Prob. 5SICh. 8 - Prob. 6SICh. 8 - Prob. 7SICh. 8 - Prob. 8SI
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning