Programming questions

Assignment Help C/C++ Programming
Reference no: EM13765284

Questions 1 and 3 are programming questions and you should have a source file as well as testing documentation.  Assignments are to be done individually.

1. a) Write a program (including timing measurements) for the following scenario. Generate 20 million random numbers, one at a time, and insert them into an array that doubles every time it runs out of space (starting size of 2), into an array that can hold 20 million elements from creation, and a linked list that can hold 20 million elements. You should do this both for integers and floating point numbers. (The numbers should be regular integers or floats). Compare the time required for each of the six scenarios, and explain the differences. You will need to write your own way to double an array size (it's up to you how to do this), don't use an ArrayList.

b) Do a brute force in order search through each of these to find the largest number. Again, compare the timings for all 6 scenarios.

2. You do not need to implement this, just describe the algorithm.

a) Assume you have a robot with a light sensor and you want it to follow a trace (i.e. line) on the ground drawn with a thick marker. Design 2 different algorithms to follow this line and compare their efficiency. (The problem is a search one - if the line bends you need to find it again). Describe/draw/illustrate some worst, or at least bad cases and best case scenarios for your algorithms.

b) Consider the same problem but in 3 dimensions, e.g. a radar array (which produces something like a cone) searching through a sphere around an aircraft looking for incoming missiles or other aircraft.

3. Attached to this assignment is a file titled "A1BoyNames.txt" it is 536 lines long, but some lines have two names separated by a comma. Read in each name into a container structure of your choosing.

a. Using a binary search, and a hash function of some sort attempt to find the names Brian, Bryan, Iain, Ian, and Stefan.

b. Modify your program to search for partial matches (e.g. Bryant would match Bryan and Brian would match Ian).

Reference no: EM13765284

Questions Cloud

What are the reasons for your recommendation : You are the criminologist advisor to a member of the state legislature. The legislature soon votes on a bill that would double the maximum prison term for anyone convicted of armed robbery, What are the reasons for your recommendation
Installment sales-default and repossession : X-Run Inc. uses the installment-sales method in accounting for its installment sales. On January 1, 2014, X-Run had an installment account receivable from Herman Pringle with a balance of $3,900.
Describes the security authentication process : Discuss how this and other information security considerations will affect the design and development process for new information systems.
Theories of crime videos in cj criminology : Resource: Theories of Crime videos in CJ Criminology, located on the student website. Social Structure Theories, Theory Explained
Programming questions : Write a program (including timing measurements) for the following scenario. Generate 20 million random numbers, one at a time, and insert them into an array that doubles every time it runs out of space (starting size of 2), into an array that can..
Problem related to the franchise entries : Burger Universe charges an initial franchise fee of $225,000. Upon the signing of the agreement, a payment of $25,000 is due. Thereafter, five annual payments of $40,000 are required.
Issue of wlan : Explore WLAN/802.11x technologies and other shorter-range wireless technologies and discuss them comparatively.
What are the six essential guidelines for editing : What are the six essential guidelines for editing? In your opinion, which of these guidelines is the most important one to consider during the editing process and why?
Discuss a moral dilemma you have faced : Write 700- to 1,050-word paper in which you discuss a moral dilemma you have faced recently in your professional life

Reviews

Write a Review

 

C/C++ Programming Questions & Answers

  Calculate the invoice for a client and then print out an inv

Prepare a program in java that can calculate the invoice for a client and then print out an invoice to the screen.

  Using an appropriatenbspcnbspsyntax write the code required

using an appropriatenbspcnbspsyntax write the code required to analyse and display the data as per the problem

  Write a c program that copies the contents of one file

write a c program that copiest the contents of one file to a destination file. This program works by first prompting the user for the name of the source file and destination file.

  Write a program in which the program prints out

Use (switch statement) to write a program in which the program prints out the input (single character) if the character is not '2','t', or 'w'. Use 'default' and 'break' wisely.

  Struct complex

A complex number can be represented by two parts, real and image. A series complex data can be organized as a group of elements by linked list, which is shown as below: struct Complex

  Write a c++ program that would take two 3x3 matrix

Write a C++ program that would take two 3x3 matrix and outputs the results of adding, subtracting and multiplying two matrices. Create at least three functions: one that performs addition,

  Explain one 1 scenario not mentioned in the textbook in

q1. describe one 1 scenario not mentioned in the textbook in which it would be advantageous for you to use a definite

  Counts the number of numbers between 150 and 200

create a program that counts the number of numbers between 150 and 200. This is what I have so far, but it's not working. It is an array of 500 number, I did not include the array because of obvious reasons.

  Write a c program to search a list of integers

Write a C program to search a list of integers for a particular value. The user should be prompted to enter the value to be searched for. Your program will then print out whether the value was found or not.

  Pointer variables to demonstrate shallow and deep copy

Using C++, write a program that uses pointer variables to demonstrate shallow and deep copy. The program should give the user the choice to do the following:

  Write a program that will be used to gather statistical

write a program that will be used to gather statistical data about the number of movies college students see in a

  Lab9 c c programplease use functions there is the details

c program ltbrgtplease use functions ltbrgtthere is the details on the attachment.zip file needs to rework on this

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