Share
Explore BrainMass

Arrays

Performing Calculations on Rows and Columns of an Array

Create an application that either sums or averages the rows or columns of a two-dimensional array depending on user choices. Use the following data for the array: 5 7 3 9 12 4 8 9 13 4 0 -1 -7 13 8 4 4 4 4 0 Create a menu bar with a File menu that includes a Perform Action comm

C program to calculate and display sales of a store

******************************************************************** Service Request: SR-kf-008 Change Request: 2 Requestor: Harvey Stephens Modify the C program so that the user inputs the purchase amount. Check the user's input for validity. Have the user select from a menu which store to use for the tax calculation

Creating an application that multiplies columns

The input must be done though text boxes. By default, the array must have the following values: 5, 2, 3 8, 32, 1 4, 9, 10 17, 15, 12 The application will multiply the columns of the matrix (e.g., 5 * 8 * 4 * 17 = 2720) and subtract the rows (e.g., 5 - 2 - 3 = 0). Display the results for the multiplication of all colu

Design a queue ADT

Design a queue abstract data type, including operations for enqueue, dequeue, and empty. I am not familiar with abstract data types.

Please modify this program so the application can handle multiple items.

Please modify this program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product.

Information Systems and Design

Questions 2-8 only require "yes" or "no." 1. If you have a program with a housekeep() module, a mainloop() module, and a finishup() module, when is the second input record usually read? 2. Is it ever correct to create a loop that cannot terminate? 3. Is it inefficient to place the calculation within the loop when a c

Programming Problems

Most programming languages do not allow you to ask two or more questions in a single comparison by using a logical And Operator Most programming languages allow you to ask two or more questions in a single comparison by using logical OR operator In an AND situation, first ask the question that is more likely to be true.

Briefly discuss Arrays.

Briefly discuss arrays. When would you use an array? Waht are the benefits? How are they created? What is a multidimensional array?

Write a program implements this sort

Simple sort for (i=0;i<SIZE;++i> for (j=i+1;j<SIZE;++j) if (a[i]>a[j] swap(&a[i],&a[j]); then modify it so that all the elements of the array are printed sfter each pass of the outer loop 7 3 66 3 -5 22 -77 2

Design a hashed file

Design a hashed file of words that could be used as a spell checker. What would you use as a hash function? Would your choice of a hash function depend on the language from which the words are chosen? Why should such a file not be stored as a sequential file? (ALSO EXPLAIN IN DETAIL)

Algorithm

Quest: In English like pseudo-code, or structured English -- just to make sure everyone can read it; write an algorithm to determine if a string is a palindrome. A palindrome is a word or phrase that is spelled the same whether you are reading it forwards or backwards (ex. race car, Madam I'm Adam). Your algorithm should igno

Suppose an array

Suppose an array with 6 rows and 8 columns is stored in row major order starting at address 20 (base ten). If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column? What if each entry requires two memory cells? (See attached file for full problem descriptio

Order-statistic tree (Augmenting Data Structures)

Need help to show how to use an order-statistic tree to count the number of inversions in an array of size n in time O(n lg n). Note that we call a pair (i,j) an inversion if i < j, but key[i] > key[j]. Thus, an increasing sequence has no inversions. A decreasing list has the maximum number of inversions, n(n-1)/2. I beli

Sorting an array of integers in linear time

How can I sort an array of integers in O(n) time, where different integers may have different numbers of digits, but the total number of digits over ALL the integers in the array is n? My assumption is that radix sort is somehow involved.

Algorithm to find majority element

Let A be an array of n elements. An element x is said to be a majority element in A if it occurs in A more than n/2 times. Assume that the only comparisons allowed between elements are tests of equality. Give an algorithm that uses no more than 2n comparisons to determine whether the array A contains a majority element and, i

Arrays in java

Write the definition of a method, isReverse , whose two parameters are arrays of integers of equal size. The method returns true if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.) So, suppose you had two int arrays, forward and backward, each with 4 elements. N

Simple script

Create a script that uses the following components: explicit declaration, an array, sub procedure, RUNAT=Server, and a function.

Computer Programming

Multi-dimensional arrays could cost a lot of memory. How much memory (how many bytes) does it take to create an integer array of 3 dimensions, with each dimension having 1000 elements (i.e. int myHugeArrays[1000] [1000] [1000])? Explain your answer.

big-inteter calculator program

Write a big-inteter calculator program that allows the user to enter two large integers and the operation to be performed and that calls the appropriate function to carry out the designated operation. **NOTE: I need the solution in C++ Code.

Deadlocks

Specification Implement the Banker's algorithm described in Section 8.5.3 using C/C++. Your program should ... 1) Prompt user to enter the size of matrix n and m. Your program should accept any n x m matrix and m vectors where n and m are positive integer less than 10. 2) Read in Allocation, Max, and Available from all

one-dimensional array and its components

Explain what a one-dimensional array and its components are. Explain why arrays are useful, and how they are created within Visual Basic .NET. Finally, explain how two-dimensional arrays are different than one-dimensional arrays. Thank you