Max Contiguous Subarray
Given a list of integers, write a program to identify contiguous sub-list that has the largest sum and print the sub-list. Any non-empty slice of the list with step size 1 can be considered as contiguous sub-list.Input
The input will contain space-separated integers, denoting the elements of the list.Output
The output should be space-separated integers.Explanation
For example, if the given list is [2, -4, 5, -1, 2, -3], then all the possible contiguous sub-lists will be,
[2]
[2, -4]
[2, -4, 5]
[2, -4, 5, -1]
[2, -4, 5, -1, 2]
[2, -4, 5, -1, 2, -3]
[-4]
[-4, 5]
[-4, 5, -1]
[-4, 5, -1, 2]
[-4, 5, -1, 2, -3]
[5]
[5, -1]
[5, -1, 2]
[5, -1, 2, -3]
[-1]
[-1, 2]
[-1, 2, -3]
[2]
[2, -3]
[-3]Among the above contiguous sub-lists, the contiguous sub-list [5, -1, 2] has the largest sum which is 6. So the output should be 5 -1 2
Sample Input 1
2 -4 5 -1 2 -3
Sample Output 1
5 -1 2
Sample Input 2
-2 -3 4 -1 -2 1 5 -3
Sample Output 2
4 -1 -2 1 5
Write a C++ Program to take two value from the user and create a menu driven code which will perform following operations using operator overloading.
1. Overload to compare two operands and check which operands have greater value and display it.
2. Overload any arithmetic operator and display its result.
Write a C++ Program to take two value from the user and create a menu driven code which will perform following operations using operator overloading.
1. Overload to compare two operands and check which operands have greater value and display it.
2. Overload any arithmetic operator and display its result.
suppose a company “abc” is conducting a test to hire you as oop developer and asked you develop a calculator for the basic arithmetic operators (+, -, *, /, %), where you have to deal at least 11 digit numbers. the numbers can be of with decimal point or without decimal point. the company wants you to develop an efficient code. you can choose any of the following options to develop this whole scenario:
1 function overloading
2 class template
Last half of List
This Program name is Last half of List. Write a Python program to Last half of List, it has two test cases
The below link contains Last half of List question, explanation and test cases
https://docs.google.com/document/d/12r-Wk4K7GMmpiGxHWymMhcXkUMBy8Okg/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
First and Last Elements of List
This Program name is First and Last Elements of List. Write a Python program to First and Last Elements of List, it has two test cases
The below link contains First and Last Elements of List question, explanation and test cases
https://docs.google.com/document/d/1LSR6d1QTXfpHGouv_GmIKkL595o6R_IK/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
List Indexing - 3
This Program name is List Indexing - 3. Write a Python program to List Indexing - 3, it has two test cases
The below link contains List Indexing - 3 question, explanation and test cases
https://docs.google.com/document/d/1F2ws8-9vz96_0wpYR82MqW1wejDjS2gf/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Create and Print List -3
This Program name is Create and Print List -3. Write a Python program to Create and Print List -3, it has two test cases
The below link contains Create and Print List -3 question, explanation and test cases
https://docs.google.com/document/d/1XFwFFMgfxj4_JbeCW_qXmh3-KnC2LtTp/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run