problem23 spring
.pdf
keyboard_arrow_up
School
Georgia Institute Of Technology *
*We aren’t endorsed by this school
Course
6040
Subject
Computer Science
Date
Dec 6, 2023
Type
Pages
41
Uploaded by ChefStraw5566
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
1/41
Midterm 1: How partisan is the US Congress?
Version 1.1b (Simplified sample solution for Exercise 6)
This problem is about basic data processing using Python. It exercises your fundamental knowledge of Python
data structures, such as lists, dictionaries, and strings. It has seven exercises, numbered 0-6.
Each exercise builds on the previous one. However, they may be completed independently. That is, if you can't
complete an exercise, we provide some code that can run to load precomputed results for the next exercise.
That way, you can keep moving even if you get stuck.
Pro-tips.
If your program behavior seem strange, try resetting the kernel and rerunning everything.
If you mess up this notebook or just want to start from scratch, save copies of all your partial
responses and use
Actions
Reset Assignment
to get a fresh, original copy of this notebook.
(Resetting will wipe out any answers you've written so far, so be sure to stash those somewhere safe if
you intend to keep or reuse them!)
If you generate excessive output (e.g., from an ill-placed
print
statement) that causes the notebook
to load slowly or not at all, use
Actions
Clear Notebook Output
to get a clean copy. The
clean copy will retain your code but remove any generated output.
However
, it will also
rename
the
notebook to
clean.xxx.ipynb
. Since the autograder expects a notebook file with the original name,
you'll need to rename the clean notebook accordingly.
Good luck!
Background
The United States Congress is the part of the US government that makes laws for the entire country. It is
dominated by two rival political parties, the Democrats and the Republicans. You would expect that these
parties oppose each other on most issues but occasionally agree.
Some have conjectured that, over time, the two parties agree less and less, which would reflect a perceived
growing ideological or political divide in the US. But is that the real trend? In this problem, you'll explore this
question using data collected by
ProPublica
(https://www.propublica.org/), a nonprofit investigative media
organization.
Setup and data loading
Run the code cells below to load the data. This code will hold the data in two variables, one named
votes
and
another named
positions
.
→
→
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
2/41
In [1]:
import
sys
print(f"* Python version:
{sys.version}
")
from
testing_tools
import
load_json, save_json, load_pickle, save_pick
le
votes = load_json("votes.json")
vote_positions = [p
for
p
in
load_json("positions.json")
if
p['positio
ns']]
print("
\n
==> Data loading complete.")
### BEGIN HIDDEN TESTS
%
load_ext
autoreload
%
autoreload
2
### END HIDDEN TESTS
Part 0: Analyzing vote results
The Congress votes on various things, like new laws or political nominations. The results of these votes are
stored in the
votes
variable loaded above. Let's look at it. First, note that
votes
is a list:
In [2]:
print(type(votes))
print("Length:", len(votes))
Vote results.
What is
votes
a list of? Each element is one
vote result.
Let's look at the first entry.
* Python version: 3.7.5 (default, Dec 18 2019, 06:24:58)
[GCC 5.5.0 20171010]
* JSON module version: 2.0.9
'./resource/asnlib/publicdata/votes.json': 28596
'./resource/asnlib/publicdata/positions.json': 279
==> Data loading complete.
<class 'list'>
Length: 28596
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
3/41
In [3]:
from
testing_tools
import
inspect_data
inspect_data(votes[0])
# View the first element of the list, `votes`
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
4/41
{
"congress": 106,
"chamber": "Senate",
"session": 1,
"roll_call": 374,
"source": "https://www.senate.gov/legislative/LIS/roll_call_votes/
vote1061/vote_106_1_00374.xml",
"url": "https://www.senate.gov/legislative/LIS/roll_call_lists/rol
l_call_vote_cfm.cfm?congress=106&session=1&vote=00374",
"vote_uri": "https://api.propublica.org/congress/v1/106/senate/ses
sions/1/votes/374.json",
"bill": {
"bill_id": "h.r.3194-106",
"number": "H.R..3194",
"sponsor_id": null,
"api_uri": null,
"title": null,
"latest_action": null
},
"question": "On the Conference Report",
"question_text": "",
"description": "H.R.3194 Conference report; Consolidated Appropria
tions Act, 2000",
"vote_type": "1/2",
"date": "1999-11-19",
"time": "17:45:00",
"result": "Agreed to",
"democratic": {
"yes": 32,
"no": 12,
"present": 0,
"not_voting": 1,
"majority_position": "Yes"
},
"republican": {
"yes": 42,
"no": 12,
"present": 0,
"not_voting": 1,
"majority_position": "Yes"
},
"independent": {
"yes": 0,
"no": 0,
"present": 0,
"not_voting": 0
},
"total": {
"yes": 74,
"no": 24,
"present": 0,
"not_voting": 2
}
}
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
5/41
Observation 0.
This first entry of the list is a dictionary, and the data structure is nested even more. For
instance, the
"bill"
key has another dictionary as its value.
Remember that what you see above is
votes[0]
, the first entry of the
votes
list. For the rest of this problem,
you may assume that all other entries of
votes
have the same keys and nesting structure.
Exercise 0
(2 points). Let's pick out a subset of the data to analyze. Complete the function below,
filter_votes(votes)
.
The input,
votes
, is a list of vote results like the one above.
Your function should return a copy of this list, keeping
only
vote results meeting the following criteria:
1. The
'vote_type'
is one of the following:
"1/2"
,
"YEA-AND-NAY"
,
"RECORDED VOTE"
2. Notice that the
'total'
key is a dictionary. Retain only the vote results where this dictionary
has
all
of the fields
'yes'
,
'no'
,
'present'
, and
'not_voting'
.
Your copy should include vote results in the same order as the input list.
Note 0:
The reason for Condition 2 above is that for some vote results, the
'total'
dictionary
does not have those fields. For an example, see
votes[18319]
. You would not include that
vote result in your output.
Note 1:
The test cell does not use real vote results, but randomly generated synthetic ones. Your
solution should
not
depend on the presence of any specific keys other than the ones you need
for filtering, namely,
'vote_type'
and
'total'
.
As an example, suppose
V
is the following vote results list (only the salient keys are included):
V = [ {'vote_type': "1/2", 'total': {'yes': 5, 'no': 8, 'present': 0, 'not_v
oting': 2}, ...},
{'vote_type': "RECORDED VOTE", 'total': {'yes': 12, 'present': 2, 'not
_voting': 1}, ...},
{'vote_type': "3/5", 'total': {'yes': 50, 'no': 14, 'present': 0, 'not
_voting': 0}, ...},
{'vote_type': "YEA-AND-NAY", 'total': {'yes': 25, 'no': 3, 'present':
3, 'not_voting': 0}, ...} ]
Then running
filter_votes(V)
would return the following new list:
[ {'vote_type': "1/2", 'total': {'yes': 5, 'no': 8, 'present': 0, 'not_votin
g': 2}, ...},
{'vote_type': "YEA-AND-NAY", 'total': {'yes': 25, 'no': 3, 'present': 3,
'not_voting': 0}, ...} ]
In this case,
V[1]
is omitted because its
'total'
key is missing the
'no'
key; and
V[2]
is omitted because
the
'vote_type'
is not one of
"1/2"
,
"YEA-AND-NAY"
, or
"RECORDED VOTE"
.
11/28/23, 8:39 PM
problem
file:///Users/dannie/Downloads/pmt1-sample-solutions-su21/problem23-sample-solutions.html
6/41
In [4]:
def
filter_votes(votes):
assert
isinstance(votes, list)
and
len(votes) >= 1
assert
isinstance(votes[0], dict)
### BEGIN SOLUTION
def
matches(v):
return
(v["vote_type"]
in
{"1/2", "YEA-AND-NAY", "RECORDED VOT
E"}) \
and
(set(v["total"].keys()) == {"yes", "no", "present",
"not_voting"})
return
[v
for
v
in
votes
if
matches(v)]
### END SOLUTION
In [5]:
# Demo cell (feel free to use and edit for debugging)
V = [ {'vote_type': "1/2", 'total': {'yes': 5, 'no': 8, 'present': 0,
'not_voting': 2}},
{'vote_type': "RECORDED VOTE", 'total': {'yes': 12, 'present':
2, 'not_voting': 1}},
{'vote_type': "3/5", 'total': {'yes': 50, 'no': 14, 'present':
0, 'not_voting': 0}},
{'vote_type': "YEA-AND-NAY", 'total': {'yes': 25, 'no': 3, 'pres
ent': 3, 'not_voting': 0}} ]
inspect_data(filter_votes(V))
print(len(filter_votes(votes)))
[
{
"vote_type": "1/2",
"total": {
"yes": 5,
"no": 8,
"present": 0,
"not_voting": 2
}
},
{
"vote_type": "YEA-AND-NAY",
"total": {
"yes": 25,
"no": 3,
"present": 3,
"not_voting": 0
}
}
]
22178
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Python
arrow_forward
Direction: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code.
Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommended
arrow_forward
Language: Python
Projectile Motion
keywords: variable creation, floats, math operations
arrow_forward
Python with Turtle
arrow_forward
In C++, the first element of the array is referenced as array[0]. Explore the web and find the history of this choice. Some languages and packages like MATLAB start the indices from 1. That is, the first element of the array is referred to as array[1] not array[0]. If you were the creators of C++, which of the conventions for the array indices would you chose? Starting from 0 or 1.
arrow_forward
2. fast please in c++
If an array is already sorted, which of the following algorithms will exhibit the best performance and why? Be precise in your answer.
Selection Sort
Insertion Sort
Merge Sort
Quick Sort
arrow_forward
### Q5: Reduce No Change Python
def reduce_no_change(fn, lst, base):
"""Same as Q4. However, preserve the lst in this problem.
Object can be any python type which the input
Not Allowed To Import Libraries
Args:
fn (function): Combination function which takes in two arguments and return
an value with the same type as the second argument
lst (List): A list of any type
base (Object): A value of custom type which fn can handle.
Returns:
Object: A value after applying fn on lst.
>>> reducer = lambda x, y: x + y
>>> lst = [1, 2, 3]
>>> a = reduce_lst(reducer, lst, 0)
>>> a # a = reducer(reducer(reducer(base, lst[0]), lst[1]), lst[2])
6
>>> lst
>>> [1, 2, 3] # we preserve the list
"""
### Modify your code here
### Modify your code here
arrow_forward
C program
Andrew practices programming a lot and recently he came across the topic of pointers. He wondered if he could use pointers to print all prime numbers from an array? Could you help him by writing a C program which takes input in an array and uses a pointer to find and print all the prime numbers from the array.
Sample Run:
Input:
1 2 3 4 5
Output:
2 3 5
arrow_forward
Python lists are commonly used to store data types. Lists are a collection of information typically called a container. Think of a physical container that can hold all kinds of objects, not just one object of the same type. Python includes a built-in list type called a list. They can be managed by many built-in functions that help fill, iterate over, add to, and delete them.
Why is it useful to store information with different data types? When do you choose to use a list over a dictionary? Provide a code example that supports your comments.
arrow_forward
Material
Java/ C++/C- language
Personal Computer.
Instructions:
A. Matrix Addition
C. Matrix Transpose
1. The transpose of an m x n matrix A is n x m matrix AT.
2. Formed by interchanging rows into columns and vice versa.
3. (A¹)kj = Ajk
4. Let m input to enter the number of rows in the Matrix.
5.
Let n input to enter the number of columns in the Matrix.
6. Display the transpose matrix
7. Save the file TRANSPM
Questions:
1. What do you mean by an array?
2. Differentiate between for loop and while loop.
3. Define transpose of matrix? What will be the order of the matrix AT, if the order of the matrix A
is 4 x 4.
arrow_forward
Make a program in C language of the following:
1. Make a tic-tac-toe game using 2D array.
Please do the above using the most simplest and efficient way possible. No use of Pointers Please.
arrow_forward
How difficult is it to duplicate a collection of shared pointers into another array while using the C++ programming language? Create a list of the several approaches you may use to tackle the issue that has been presented to you. Is it the case that copying a shared pointer also copies the objects that it controls? Explain
arrow_forward
PYTHON + DATAFRAMES (pandas)
import pandas as pd
crimeData = {'agency_code': ['UT01803','TXSPD00','CA03711','MOSPD00','NY05101'],
'location': ['Salt Lake City, UT','San Antonio, TX','San Diego, CA','St. Louis, MO','Suffolk County, NY'],
'population': [191992,1463586,1400467,317095,1341453],
'homicides': [8,94,37,188,24],
'assaults': [874,5465,3601,3521,895],
'robberies': [469,1986,1378,1790,677]}
df = pd.DataFrame(crimeData)
df.set_index('agency_code', inplace=True)
homicidesPerCapita = {'homicides_per_capita':[4,6,3,59,2,9]}
df2 = pd.DataFrame(homicidesPerCapita)
df3 = df.join(df2)
df3
Questions:
Why is printing homicides_per_capita as NaN?
Sort the DataFrame by homicides per capita from greatest to least on the original DataFrame
Filter/reduce the DataFrame down to only those with more than 50 total homicides OR (not 'and') over 5000 assaults
Print the DataFrame
Thanks!
arrow_forward
Use C Language
Pascal’s Triangle Version 2
The Pascal triangle can be used to compute the coefficients of the terms in the expansion
(a + b)n. For example, (a + b)2 = a2 + 2ab + b2 where 1, 2, and 1 are coefficients. Write a C program that creates a two-dimensional matrix a representing the Pascal triangle of size n. For example, a Pascal triangle of size 10 is shown below:
arrow_forward
python:
def character_gryffindor(character_list):"""Question 1You are given a list of characters in Harry Potter.Imagine you are Minerva McGonagall, and you need to pick the students from yourown house, which is Gryffindor, from the list.To do so ...- THIS MUST BE DONE IN ONE LINE- First, remove the duplicate names in the list provided- Then, remove the students that are not in Gryffindor- Finally, sort the list of students by their first name- Don't forget to return the resulting list of names!Args:character_list (list)Returns:list>>> character_gryffindor(["Scorpius Malfoy, Slytherin", "Harry Potter, Gryffindor", "Cedric Diggory, Hufflepuff", "Ronald Weasley, Gryffindor", "Luna Lovegood, Ravenclaw"])['Harry Potter, Gryffindor', 'Ronald Weasley, Gryffindor']>>> character_gryffindor(["Hermione Granger, Gryffindor", "Hermione Granger, Gryffindor", "Cedric Diggory, Hufflepuff", "Sirius Black, Gryffindor", "James Potter, Gryffindor"])['Hermione Granger, Gryffindor',…
arrow_forward
python:
def character_gryffindor(character_list):"""Question 1You are given a list of characters in Harry Potter.Imagine you are Minerva McGonagall, and you need to pick the students from yourown house, which is Gryffindor, from the list.To do so ...- THIS MUST BE DONE IN ONE LINE- First, remove the duplicate names in the list provided- Then, remove the students that are not in Gryffindor- Finally, sort the list of students by their first name- Don't forget to return the resulting list of names!Args:character_list (list)Returns:list>>> character_gryffindor(["Scorpius Malfoy, Slytherin", "Harry Potter,Gryffindor", "Cedric Diggory, Hufflepuff", "Ronald Weasley, Gryffindor", "LunaLovegood, Ravenclaw"])['Harry Potter, Gryffindor', 'Ronald Weasley, Gryffindor']>>> character_gryffindor(["Hermione Granger, Gryffindor", "Hermione Granger,Gryffindor", "Cedric Diggory, Hufflepuff", "Sirius Black, Gryffindor", "JamesPotter, Gryffindor"])['Hermione Granger, Gryffindor', 'James…
arrow_forward
Write a Menu driven Program which include these operations like Creating an array, insertion, deletion and fetching all the elements from an array?(write the program in c++ language)
arrow_forward
RESTRICTIONS:
- Do not add any imports and do it on python .Do not use recursion. Do not use break/continue.Do not use try-except statements
def cost_to_hike_naive(m: list[list[int]], start_point: tuple[int, int], end_point: tuple[int, int]) -> int: """ Given an elevation map <m> and a start and end point, calculate the cost it would take to hike from <start_point> to <end_point>. If the start and end points are the same, then return 0.
Some definitions and rules: 1. You can only hike to either a vertically or horizontally adjacent location (you cannot travel diagonally).
2. You must only travel in the direction of the <end_point>. More explicitly, this means that any move you make MUST take you closer to the end point, so you cannot travel in the other direction.
3. We define the cost to travel between two adjacent blocks as the absolute difference in…
arrow_forward
List is a primitive data type in Python. True or False
arrow_forward
c++language
arrow_forward
Please answer the above question in python programming language
arrow_forward
Oops! I had some typos in that last questions.The input/output examples were wrong
In the C(89) standard of C programming languageSuppose you are given an array of integers. You want to insert a number x to the array and rearrange so that all the elements are less than or equal to x are before x, and the elements after x are greater than x. For example, suppose the list is {3, 2, 7, 0 1, 5} and x is 4, since 3, 2, 0, and 1, are less than or equal to 4, 7and 5 are greater than 4, the new array is {3, 2, 0, 1, 4, 7, 5}. The new array has the length of n+1 where n is the length of the input array.Example input/output #1:Enter the length of the array: 10Enter the elements of the array: 3 5 1 4 0 3 9 2 8 11Enter the number for insertion: 3Output: 3 1 0 3 2 3 5 4 9 8 11Example input/output #2: Enter the length of the array: 8Enter the elements of the array: 5 0 13 4 1 7 3 5Enter the number for insertion: 6Output: 5 0 4 1 3 5 6 13 71) Name your program arrays.c2) Include the rearrange( )…
arrow_forward
How easy is it to copy a set of shared pointers into another array in C++? Make a list of different ways to solve the problem you've been given. Is it true that when you copy a shared pointer, you also copy the objects it controls? Explain
arrow_forward
C+++ proram An organization is going to design a small database to store the records of students. They hire you in the development team and assign a small module of the project. You have to store the firstName, LastName, address, sapId, semester, and CGPA of all the students in a class. You are supposed to use 2D character array to store firstName and lastName. To test the working of your module you can fix the class size to 15. Pass these arrays into a displayRecord function which display complete information of all the students in a class. Create a function updateRecord which receives the sapId and search that whether this sapId exist in the array. If it exists than change the firstName, address and CGPA of that student otherwise display a simple message that "record does not exist
arrow_forward
Python 3
NO IMPORT PICKLE
Please check the picture and add one more function(def) and fix the error in the code.
Write a program that keeps names and email addresses in a dictionary as key-value pairs. You Must create and use at least 5 meaningful functions.
A function to display a menu
A function to look up a person’s email address
A function to add a new name and email address
A function to change an email address
A function to delete a name and email address.
This is the Required Output example:
Menu
----------------------------------------
1. Look up an email address
2. Add a new name and email address
3. Change an existing email address
4. Delete a name and email address
5. Quit the program
Enter your choice: 2
Enter name: John
Enter email address: John@yahoo.com
That name already exists
Menu
----------------------------------------
1. Look up an email address
2. Add a new name and email address
3. Change an existing email address
4. Delete a name and email address…
arrow_forward
PYTHON 3
def get_total_grade(info_list, show_steps = False): """ param: info_list - a list that contains dictionaries param: show_steps - a Boolean flag (False by default) controls whether the function outputs intermediate steps, outputting the average scores.
Each dictionary in the info_list is supposed to have the following string keys: - category - the name of each grade category (string) - weight - the percentage weight of the category (float) - grades - a list of numeric grades for each assignment If no grades are stored for a category, the "grades" item will store an empty list.
return: The function returns a floating-point value that results from summing up the product of the weight of each category with the average value of each "grades" list. The function returns 0 if the info_list is empty.
Helper functions: The function calls the following helper functions: - get_grades() to extract the grades…
arrow_forward
DO NOT COPY FROM OTHER WEBSITES
Correct and detailed answer will be Upvoted else downvoted. Thank you!
arrow_forward
In PYTHON. Numpy needs to be imported
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Pythonarrow_forwardDirection: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code. Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommendedarrow_forwardLanguage: Python Projectile Motion keywords: variable creation, floats, math operationsarrow_forward
- Python with Turtlearrow_forwardIn C++, the first element of the array is referenced as array[0]. Explore the web and find the history of this choice. Some languages and packages like MATLAB start the indices from 1. That is, the first element of the array is referred to as array[1] not array[0]. If you were the creators of C++, which of the conventions for the array indices would you chose? Starting from 0 or 1.arrow_forward2. fast please in c++ If an array is already sorted, which of the following algorithms will exhibit the best performance and why? Be precise in your answer. Selection Sort Insertion Sort Merge Sort Quick Sortarrow_forward
- ### Q5: Reduce No Change Python def reduce_no_change(fn, lst, base): """Same as Q4. However, preserve the lst in this problem. Object can be any python type which the input Not Allowed To Import Libraries Args: fn (function): Combination function which takes in two arguments and return an value with the same type as the second argument lst (List): A list of any type base (Object): A value of custom type which fn can handle. Returns: Object: A value after applying fn on lst. >>> reducer = lambda x, y: x + y >>> lst = [1, 2, 3] >>> a = reduce_lst(reducer, lst, 0) >>> a # a = reducer(reducer(reducer(base, lst[0]), lst[1]), lst[2]) 6 >>> lst >>> [1, 2, 3] # we preserve the list """ ### Modify your code here ### Modify your code herearrow_forwardC program Andrew practices programming a lot and recently he came across the topic of pointers. He wondered if he could use pointers to print all prime numbers from an array? Could you help him by writing a C program which takes input in an array and uses a pointer to find and print all the prime numbers from the array. Sample Run: Input: 1 2 3 4 5 Output: 2 3 5arrow_forwardPython lists are commonly used to store data types. Lists are a collection of information typically called a container. Think of a physical container that can hold all kinds of objects, not just one object of the same type. Python includes a built-in list type called a list. They can be managed by many built-in functions that help fill, iterate over, add to, and delete them. Why is it useful to store information with different data types? When do you choose to use a list over a dictionary? Provide a code example that supports your comments.arrow_forward
- Material Java/ C++/C- language Personal Computer. Instructions: A. Matrix Addition C. Matrix Transpose 1. The transpose of an m x n matrix A is n x m matrix AT. 2. Formed by interchanging rows into columns and vice versa. 3. (A¹)kj = Ajk 4. Let m input to enter the number of rows in the Matrix. 5. Let n input to enter the number of columns in the Matrix. 6. Display the transpose matrix 7. Save the file TRANSPM Questions: 1. What do you mean by an array? 2. Differentiate between for loop and while loop. 3. Define transpose of matrix? What will be the order of the matrix AT, if the order of the matrix A is 4 x 4.arrow_forwardMake a program in C language of the following: 1. Make a tic-tac-toe game using 2D array. Please do the above using the most simplest and efficient way possible. No use of Pointers Please.arrow_forwardHow difficult is it to duplicate a collection of shared pointers into another array while using the C++ programming language? Create a list of the several approaches you may use to tackle the issue that has been presented to you. Is it the case that copying a shared pointer also copies the objects that it controls? Explainarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education