Question

C++ write a function to evaluate the length of a lost. Do not assume the list...

C++
write a function to evaluate the length of a lost. Do not assume the list is the same length as above.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Brother I think there is something missing. List is not given. Please let me know I would help as much as I can.

Kindly revert for any queries

Thanks.

Add a comment
Answer #2

#include<iostream>
#include <stdio.h>

using namespace std;

int main()
{
   int arr[]={2,4,7,9,10};//testing with this list
   int n = (sizeof(arr)/ sizeof(arr[0]));//finding length
   cout<<n<<endl;//displaying length
  
   return 0;
}

output:

5

Add a comment
Know the answer?
Add Answer to:
C++ write a function to evaluate the length of a lost. Do not assume the list...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In c++, write a function that prints every other element in a linked list. Assume that...

    In c++, write a function that prints every other element in a linked list. Assume that it is a member function of a doubly linked list. This means you will need to use pointer operations.

  • In C++ Do not use classes. Write a function to add two integers of any length,...

    In C++ Do not use classes. Write a function to add two integers of any length, say up to 200 digits. he suggested approach as follows: treat each number as a list array, each of those elements is a block of digits of that number ( say block of 1 to 4 digits, your choice). For example the integer 123456789101112 might be stored as N(1)=1112, N(2)=8910, N(3)=4567, N(4)=123. then add two integers (list) element by element, caring from one element...

  • Can someone do this python program? Write a function that accepts a list of five numbers...

    Can someone do this python program? Write a function that accepts a list of five numbers from a user and prints the length, sum, average, and largest number of the list.

  • 1. Write a function using C++ which will determine the length of a circularly linked list....

    1. Write a function using C++ which will determine the length of a circularly linked list. 2. Determine if the expression is true or false. Give a reason for your conclusion. (a) Is n lg(n + 17) ∈ O(n 2 )? (b) Is n 2 ∈ O(n √ n)? (c) Is 3n ∈ O(n 3 )? (d) Is 2n ∈ O(3n )? (e) Is lg(lg(lg(n))) ∈ O(n)?

  • The language is python Write the function largest_edge_group(vertices) that consumes vertices, a list of list of...

    The language is python Write the function largest_edge_group(vertices) that consumes vertices, a list of list of integer containing the coordinates of the consecutive vertices of a polygon. The function largest_edge_group returns the size of the largest group of same length edges. Your function must run in O(n), where n is the length of vertices. Example largest_edge_group([[0,0],[1,1],[0,2],[-2,3],[-1,2]]) => 3 Hint Remember, it is not possible to compare Floats for strict equality, but since the coordinates are integers, the squared distance is...

  • In LISP write one function using length that gets the last atom in a list and...

    In LISP write one function using length that gets the last atom in a list and another function that triples all the elements in a list (triple-value '(1 2 3 4 5)) so the result should be (1 8 27 64 125)

  • Write a function that takes as an input parameter an integer that will represent the length...

    Write a function that takes as an input parameter an integer that will represent the length of the array and a second integer that represents the range of numbers the random number should generate (in other words, if the number is 50, the random number generator should generate numbers between 0 and 49 including 49. The function then sorts the list by traversing the list, locating the smallest number, and printing out that smallest number, then replacing that number in...

  • Python 2.7 Write a function cumsum() that takes a list l as argument and returns the...

    Python 2.7 Write a function cumsum() that takes a list l as argument and returns the cumulative sum (also known as the prefix sum) of l, which is a list, say cs of the same length as l such that each element cs[i] is equal to the sum of the first i + 1 elements of l, i.e., cs[i] == l[0] + l[1] + l[2] + ... + l[i] You should not modify the argument list l in any way....

  • - 1 $(2) - 8.0 a) Create a function file to evaluate f(x). Write the commands...

    - 1 $(2) - 8.0 a) Create a function file to evaluate f(x). Write the commands used to create the function file. b) Obtain 5 numbers decreasing to zero. Write the commands used. c) Evaluate f(x) at the list of numbers approaching zero, write the results, and determine limo-+0+ f(x).

  • C programming Write an iterative and recursive version of a function to print out a linked...

    C programming Write an iterative and recursive version of a function to print out a linked list from head to tail and then do the same for printing a linked list from tail to head. Assume a singly linked list in all cases and access only to a head pointer at the time of the function call. struct node; typedef struct node Node; struct node int data; Node next;

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT