Computer Science Homework Solutions
Problem
#106677

C++ List

Write C++ code that does the following:
 Create a list with the elements: 43,67,11,78 and 52
 Add item 60 to the list
 Sort the list in descending order
 Delete item 52
 Use Binary Search to find item 70 in the list


Sample output shown:

Printing the 5 elements in the list…
43 67 11 78 52
The length of the list is 5
Adding item 60…..
43 67 11 78 52 60
The length of the list is 6
Sorting the list in descending order….
78 67 60 52 43 11
Deleting item 52….
78 67 60 43 11
The length of the list is 5
Item 70 not found in the list.

Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$27.93)
Included in Download
  • Plain text response
  • Attached file(s):
    • 106677.cpp
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Database - Create a query that lists all cities in descending order - I need help. I have to create a query that lists all cities in descending order. Each city should appear only once.
  • Using arrays in C programming. - How do I write a program that will read ten integers from the keyboard and place them in an array? The program must then sort the array into ascending and descending order and print the sorted lists. ...
  • Java program which sorts a 10 element integer array - Design and implement a Java program which sorts a 10 element integer array using the bubble sort process. The elements of the array to be sorted should be supplied by the user and should not include a ...
  • Sorting Algorithm - Please assist so that I can complete the following: You will create a program that runs a sorting algorithm on a set of randomized values. Your program should run the algorithm several times, to ge ...
  • A problem about Sorting in Java - Part (A) Sort the array 15 80 35 25 60 30 into descending order using a) the selection sort. b) the buble sort. Part (B) A first year student attempted to write mergesort in pseudoco ...
Browse