Reference no: EM13165817
Write a program that checks if a sort being used is stable (Use function pointer to pass the function of the sort routine).
For example,
1. I have an array of ints (4, 5, 6, 5, 4, 6)
2. You assign each int with a particular ID.
Array (4, 5, 6, 5, 4, 6)
ID (1, 2, 3, 4, 5, 6)
The first element, which is four, is assigned with ID 1.
The second element, which is five, is assigned with ID 2.
and so on.......
3. Sort the array.
Array (4, 4, 5, 5, 6, 6)
ID (1, 5, 2, 4, 3, 6)
This sort is stable because
First int 4's ID (1) < second int 4's ID (5)
First int 5,s ID (2) < second int 5's ID (4)
Explores the performance consequences
: This problem explores the performance consequences of having only a single level of cache in a modern processor with 40 ns DRAM column access time and a clock period of 400 ps (clock frequency 2.5 GHz). You are given the following data: A particul..
|
A file system stores every file under a i-node
: suppose a file system stores every file under a i-node similar to (but may not be the same as) the Unix V7 File System. The i-node contains 15 addresses, each address has 32 bits (4 bytes).
|
Value referenced by the pointer.
: Add 10 to the value referenced by pointer switch.Add 4 to the address stored in pointer switch.Subtract 5 from the value referenced by the pointer.
|
Create an application for disney''s cottages
: Create an application for Disney's Cottages, a weekend getaway resort that rents cottages and boats to use on the local lake
|
You assign each int with a particular id
: You assign each int with a particular ID.Array (4, 5, 6, 5, 4, 6) ID (1, 2, 3, 4, 5, 6)
|
A machine has a 32-bit address space and an 4-kb page
: A machine has a 32-bit address space and an 4-KB page. Suppose a simple OS just boot up on the machine, running a single process. The process uses 2 memory pages for the text and data memory (combined) near the lowest virtual address, and 1 memory pa..
|
If ptr is a pointer to a character
: If ptr is a pointer to a character and has been initialized to point to the first element of arr, write a statement using ptr that is equivalent to the statement array[4] = 12.
|
Various search trees and numerous sorting techniques
: This week we were introduced to various search trees and numerous sorting techniques. Taking into consideration what you have learned this week, discuss how you can help Bob with his problem.
|
Test a program that prompts for the user
: Write and test a program that prompts for the user to input a file name and uses two functions head() and tail() - head() displays the first 10 lines of a file
|