Lab 2 R PDF
.pdf
keyboard_arrow_up
School
Drexel University *
*We aren’t endorsed by this school
Course
410
Subject
Computer Science
Date
Jan 9, 2024
Type
Pages
10
Uploaded by MegaOysterMaster676
10/4/23, 5
:
41 PM
Lab 2 R markdown
Page 1 of 10
file:///Users/mathabib/Documents/R%20files/Lab-2-Markdown.html
Lab 2 R markdown
MH
2023-10-04
1: Overview
myData = read.csv("/Users/mathabib/Downloads/list_1.csv")
sample(1:50, 100, replace = T)
## [1] 42 17 30 13 18 33 17 17 24 23 34 40 14 7 13 1 28 12 12 46 46 29 27 40 47
## [26] 14 28 12 18 48 1 43 23 12 31 4 22 20 7 39 49 11 15 8 7 3 10 45 46 10
## [51] 50 7 47 16 4 5 33 6 49 38 15 5 3 9 27 45 47 12 12 12 44 42 48 45 26
## [76] 45 37 16 7 46 34 35 22 43 36 44 21 42 30 26 21 33 13 7 42 3 13 29 11 31
2: Frequency Tables
freq_data=read.csv("/Users/mathabib/Downloads/list_1.csv")
table(freq_data)
## X1
## 0 1 2 3 4 5 6 7 8 9 ## 4 4 6 8 4 7 3 4 6 3
transform(table(freq_data))
## X1 Freq
## 1 0 4
## 2 1 4
## 3 2 6
## 4 3 8
## 5 4 4
## 6 5 7
## 7 6 3
## 8 7 4
## 9 8 6
## 10 9 3
10/4/23, 5
:
41 PM
Lab 2 R markdown
Page 2 of 10
file:///Users/mathabib/Documents/R%20files/Lab-2-Markdown.html
d=sample(1:100,1000,replace=T)
bins=seq(0,100,by=10)
cut_data=cut(d,bins)
table(cut_data)
## cut_data
## (0,10] (10,20] (20,30] (30,40] (40,50] (50,60] (60,70] (70,80] ## 101 94 116 99 112 93 97 94 ## (80,90] (90,100] ## 89 105
Exercise 1:
Var1=sample(1:10, 1000, replace=T)
bins=seq(0,10,by=1)
cut_data=cut(Var1,bins)
table(cut_data)
## cut_data
## (0,1] (1,2] (2,3] (3,4] (4,5] (5,6] (6,7] (7,8] (8,9] (9,10] ## 114 100 85 117 98 79 105 98 110 94
Exercise 2:
cumsum(table(cut_data))
## (0,1] (1,2] (2,3] (3,4] (4,5] (5,6] (6,7] (7,8] (8,9] (9,10] ## 114 214 299 416 514 593 698 796 906 1000
The entries in this script di
ff
er from those in the previous script in that in each bin, the frequency value
represents everything underneath the upper limit of said bin. Meaning if there is a frequency of 2 between 1
and 2 and a frequency of 2 between 2 and 3, the 2:3 bin will show a frequency of 4.
3: Bar Graphs:
x=c(0,1,2,3,4,5,6,7,8,9)
f=c(4,4,6,8,4,7,3,4,6,3)
barplot(f,names.arg=x,ylim=c(0,10),col="blue",xlab="number",ylab="Frequency",main="Ti
tle")
10/4/23, 5
:
41 PM
Lab 2 R markdown
Page 3 of 10
file:///Users/mathabib/Documents/R%20files/Lab-2-Markdown.html
Exercise 1:
cod_data=c(6,12,7,9,15,8,7,11,20,10,8,18,5,12,7,8,5,15,10,9,5,8,72,7,21,10,12,9,6,6,1
4,12,21,11,5,9,6,12,8,8,12,6,9,4,19,32,9,11,16,5)
table(cod_data)
## cod_data
## 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 32 72 ## 1 5 5 4 6 6 3 3 6 1 2 1 1 1 1 2 1 1
cumsum(table(cod_data))
## 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 32 72 ## 1 6 11 15 21 27 30 33 39 40 42 43 44 45 46 48 49 50
10/4/23, 5
:
41 PM
Lab 2 R markdown
Page 4 of 10
file:///Users/mathabib/Documents/R%20files/Lab-2-Markdown.html
x=c(4,5,6,7,8,9,10,11,12,14,15,16,18,19,20,21,32,72)
f=c(1,5,5,4,6,6,3,3,6,1,2,1,1,1,1,2,1,1)
barplot(f,names.arg=x,ylim=c(0,10),col="pink",xlab="cod weight",ylab="Frequency",main
="Frequency of Cod Weights")
Something wrong with this graph is that the spacing between the cod weights are not regular, so it is unclear
what bars correspond to what weights. This could be solved by reducing text size so each label can be
visible.
Exercise 2:
d=read.csv(("/Users/mathabib/Downloads/death_data.csv"),header=T)
#Get data on number of deaths for top causes
c=d$Cause #Stores the column labeled "Cause" into the vector c
f=d$Deaths #Stores the column labeled "Deaths" into the vector f
barplot(f/100000, names.arg=c, cex.names=.5, ylab="Hundred thousand deaths", col="bla
ck")
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
Q4:
arrow_forward
x: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
y: [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
z: [31, 32, 33, 34, 35, 36, 37, 38, 39, 40]
Use the dic1 in item a to create a dictionary (dic3) of key “mlt” where the corresponding indices of x, y, and z keys of dic1 are multiplied. dic3 is expected to be as follows:
dic3 = {mlt: [11*21*31, 12*22*32, 13*23*33,...]}Python
arrow_forward
Attach File
Browse My Computer
QUESTION 2
- use Eclipse to create a project.
create a new class containing a main function.
- Create a function describing the bubble sort to sort a LinkedList of Integers in the decreasing order (from the largest number to the smallest number). The
function should accept a LinkedList and returm a LinkedLlist. Add also statements to trace the progress of bubble sort to display the LinkedList contents after each
exchange.
The main function should contain at least two test examples of the bubble sort function that you have create on various ordered and random LinkedList of
Integers.
NB: Send only the Java file containing your work.
If the program dose not compile, marks will be reduced.
if the program dose not properly as described above, marks will be reduced.
Attach File
Browse My Computer
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
XI 門
arrow_forward
Consider the following list: L = ['bran', 'tyrion', 'jon', 'sansa', 'drogon', 'ned', 'arya', 'ghost']
In the table below, show the contents of the list after each of the first three iterations of the outer while-loop in merge_sort
arrow_forward
PYTHON prov_records_per_date() takes a 2-D list (similar to the database) and an integer representing the province ID. This function returns another 2-D list, where each element of this list stores information in the following format.
[ [day1, total number of patients (both icu and non-icu) in this provice reported in day1], [day2, total number of patients (both icu and non-icu) in this provice reported in day2], ... ]
>>> results = prov_records_per_date(database, 35)
>>> display_dict(result) >>> display_list(result) ['2022-01-31', 239] ['2022-02-05', 393]
>>> results = prov_records_per_date(database, 10) >>> display_dict(result)['2022-02-02', 225]
>>> results = prov_records_per_date(database, 81) >>> display_dict(result)No data in list
arrow_forward
PARTS file with Part# as the hash key (K) includes records with the following Part# values:2360, 3760, 5232, 4692, 4871, 2659, 1821, 3074, 7115, 1620, 2428, 1943,
4750, 2975, 4981, 1111, 3123, 3211, 5654, and 2208. The hash file has 30 cells , numbered 0 to 29. Eachcell holds one record.
Calculate the average search length for searching all entries.
arrow_forward
1211] - Read-Only - Word
O Search
References
Mailings
Review
View
Help
20 - Hash index entries are assigned to.
a) Values
b) Clusters
c) Buckets
d) Blocks
21 - what are the index of an efficient bitmaps index?
a) Each bucket has initially one block. Any additional blocks are allocated and linked to an initial
block
b) The WHERE clause may specify any values in upper ways. The column used in a WHERE clause
may contain mixed upper- and lower-case characters.
c) The database can quickly determine the block containing a table row from the index row mumber.
Any indexed column relatively few distinct values.
d) Indexes change only when primary key values are updated. physical indexes change whenever a
row moves to a new block.
22 - A column contains grades from 0 to 10, but uh where clause specifies values from 0 to 100. A.
index can be used to modify the column values and process the queries.
a) Multi - level
b) logical
c) single - level
d) function
23 - In logical index, pointers to table…
arrow_forward
Computer Science
Find all files that are larger than 20MB, redirect list to BigFileList.txt.Find all files that have update time in last one week, redirect list to UpdatedFileInLastWeek.txt.
arrow_forward
2. Each student at Middlesex County College takes a different number of courses, so the
registrar has decided to use linear linked lists to store each student's class schedule
and an array to represent the entire student body.
A portion of this data structure is shown below:
link
Sec cr
CSC16213
→HISHO 24
$||1||
1/1234
2/2 357
CSC236/4
37
These data show that the first student (ID: 1111) is taking section 1 of CSC162 for 3
credits and section 2 of HIS101 for 4 credits; the second student is not enrolled; the
third student is enrolled in CSC236 section 4 for 3 credits.
s
Write a class for this data structure. Provide methods for creating the original array,
inserting a student's initial class schedule, adding a course, and dropping a course. Include
a menu-driven program that uses the class.
arrow_forward
List data_list contains integers read from input, representing a sequence of data values. For each index i of data_list from 1 through the second-to-last index:
The element at index i is a drop if the element is less than both the preceding element and the following element.
If the element at index i is a drop, then output 'Drop: ', followed by the preceding element, the current element, and the following element, separating each element by a space.
arrow_forward
↓
11₁
may be removed, but a new item could be added right after the existin
Sample output from startup code
Output - ICA01_Start (run) X
e
32
E
9
·9:-V
EE/-T/-E
CPS 151 ICA 1 by
Enter the maximum size: 15
Enter the starting size: 8
Original List
100 101 102 103 104 105 106 107
Position to delete from: 5
Invalid delete position, no changes made
Value to insert: 999
At what position? 3
Invalid insert position, no changes made
Final List
100 101 102 103 104 105 106 107
Goodbye
BUILD SUCCESSFUL (total time: 27 seconds)
5
ENG E
arrow_forward
choose the correct answer
An application requires to maintain the history of past events. the best data structure is:
a.
Linked List with History
b.
Queue
c.
Stack
d.
Linked List
An application requires frequent insertion and deletion of data. The data to be inserted is large. Which data structure you will choose?
a.
Array
b.
Stack
c.
Linked List
d.
queue
An application requires strict ordering of jobs to be processed on a first-come-first-served basis. Which data structure you will choose?
inked List
b.
Double Linked List
c.
Stack
d.
Queue
Consider a linked List with just one node. The first node in the list is referred by 'head'. Now, if we execute the code: head=head.next
What will happen?
a.
Another 'head' is assigned to the first node
b.
head points to the last node which is not null
c.
head points to the next node which is not null
d.
We lose the…
arrow_forward
Which of the following procedures may be performed in constant time on an unsorted singly linked list with head and tail references?
Select the most complete option.
(1) Insertion at the beginning of the linked list (2) Insertion at the end of the linked list (3) Remove the front node of the linked list (4) Remove the last node of the linked list (1) and (2) (1) and (3) O (1), (2), and (3) O (1), (2), and (3) O (1), (2), and (3) O (1), (2), and (3) O (1), (2), and (4) None of the above
arrow_forward
Python pandas exersize
Dataset url = 'https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv'
1. Import the necessary libraries
2. Import the dataset from url
3. Assign it to a variable called var.
4. How many products cost more than $10.00?
5. What is the price of each item?
arrow_forward
program9_1.pyThis assignment requires you to create a dictionary by reading the text file created for the Chapter 6 assignment. The dictionary should have player names for the keys. The value for each key must be a two-element list holding the player's goals and assists, respectively. See page 472! Start with an empty dictionary. Then, use a loop to cycle through the text file and add key-value pairs to the dictionary. Close the text file and process the dictionary to print the stats and determine the top scorer as before. In fact, much of the code used in program6_2.py can be copied and used for this program. Printing the stats for each player is the most challenging part of this program. To master this, refer to the examples in the zip file that can be downloaded from the "Dictionary values can be lists" link in the "Learn Here" part of this module. NOTE: you do not need to submit the text file. Submit just this program. The required output should be the same well-formatted table as…
arrow_forward
program9_1.pyThis assignment requires you to create a dictionary by reading the text file created for the Chapter 6 assignment. The dictionary should have player names for the keys. The value for each key must be a two-element list holding the player's goals and assists, respectively. See page 472! Start with an empty dictionary. Then, use a loop to cycle through the text file and add key-value pairs to the dictionary. Close the text file and process the dictionary to print the stats and determine the top scorer as before. In fact, much of the code used in program6_2.py can be copied and used for this program. Printing the stats for each player is the most challenging part of this program. To master this, refer to the examples in the zip file that can be downloaded from the "Dictionary values can be lists" link in the "Learn Here" part of this module. NOTE: you do not need to submit the text file. Submit just this program. The required output should be the same well-formatted table as…
arrow_forward
Q9:-
Which data-type .maketrans() return?
Table
List
Tuple
Dictionary
Q 10:-
How to loop over the float range?
Arange
Enumerate
Range
None of these
Q4:-
Which of the following is correct ?
deafaultdict throws a KeyErrror when the key is not present in it.
Sorting dictionary by the key has more runtime accessing than the sorting by the value.
c)Sorting dictionary by the key has less runtime accessing than the sorting by the value.
d).None of these.
Q5:-
Choose the correct statement:-
getattr() and setattr() are used to retrieve and set class attributes.
pow() and ** will always produce the same value.
getattr() and setattr() are used to retrieve and set Constructor attribute.
None of these.
arrow_forward
Please help me with this error
arrow_forward
Using the four lists provided in the cell below, complete the following using indexing/slicing: use pyhton
Use forward indexing to store the third value in list_1 to index_1
Use negative indexing to store the last value in list_2 to index_2
Use slicing to store the second through fourth values (inclusive) of list_3 to index_3
Use slicing to store the last two values of list_4 to index_4
Note: Slices should store information in the same order as the original list.
arrow_forward
Q7: Using the AIRPORT KLX Table (Textbook page 131), describe an example that illustrates the insertion anomaly.
Q8: Using the AIRPORT KLX Table (Textbook page 131), describe an example that illustrates the deletion anomaly.
Q9: Using the AIRPORT KLX Table (Textbook page 131), describe an example that illustrates the modification anomaly.
arrow_forward
def read_cars(full_path_file_name):"""Read the data from csv file given full path file name (including directory)Return a list of Car instances:param full_path_name: csv file:return: list of instances of the Car class"""
file:
2017,Subaru,WRX,268,32722000,Honda,Civic Si,160,26122020,Lamborghini,Aventador S,729,34722017,Subaru,WRX,268,32722000,Honda,Civic Si,160,26122020,Lamborghini,Aventador S,729,34722017,Subaru,WRX,268,32722000,Honda,Civic Si,160,26122020,Lamborghini,Aventador S,729,34722020,Lamborghini,Huracan,729,3472
arrow_forward
Pease help with Python coding, my code does not run
arrow_forward
Open the file Cybersecurity * Courses.txt and read in all of the USF cybersecurity core courses. * * Create a linked list with each node * containing the following variables: * courseID, courseName, taken, next. * * Ted has completed the following courses: * IT Concepts, Foundations of * Cybersecurity, Human Aspects of * Cybersecurity, Human Computer Interfaces, * and Web Systems for IT * * Mark each of these courses as being * "taken" in the linked list. * * Traverse the linked list and print out * all of the courses that Ted still needs * to take in order to graduate.
(picuture below is the txt file )
arrow_forward
Inserting Nodes into the List:
In the following code (This is Code By C) : there are 3 functions :
display, insert_begin, and delete.
The request is add two functions :
First Function (insert_last) : to insert values from last.
Second Function (insert_mid): to insert values from Middle.
Please Run the code before send it... thanks...
The code:
#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>
struct node{int info;struct node* next;};
struct node* start;
void display();void insert_begin();
void delete();
int main(){
int choice;start = NULL;
while (1){printf("\n\t\t MENU \t\t\n");printf("\n1.Display\n");printf("\n2.Insert at the beginning\n");printf("\n3.Insert at the end\n");printf("\n4.Delete\n");printf("\n5.Exit\n");
printf("Enter your choice:\t");scanf_s("%d", &choice);
switch (choice){case 1:display();break;case 2:insert_begin();break;case 3:delete();break;case 4:exit(0);break;default:printf("\nWrong Choice.\n");break;}
}return…
arrow_forward
Database cource:
a. Display student name and department name using the above view.
b. Write a plsql program using cursors to display contents of table Dept.
arrow_forward
3. Create linked list to enroll the students who wish to participate for a gaming event by taking details like Name, Register No., Age, Phone number. Ensure that no more than five members are there in the list with same age. Perform insertion(), deletion() and display() operations on the Linked list
arrow_forward
def count_never_close(directorypath,list_of_locations,distance):"""return how many of the entities in the directory are never withinthe distance of any of the locations in the list.:param directorypath::param list_of_locations: list of tuples (lat,long):param distance::return: the count"""passENTITIES:ID,City,State,Latitude,LongitudeA45419E,Plattsburgh,NY,44.704021,-73.471148A19312D,Aiken,SC,33.554433,-81.69588A90172S,Tuscaloosa,AL,33.170238,-87.616169A19394D,Alexandria,VA,38.819853,-77.059645A27218D,Pittsburgh,PA,40.47441,-79.950968A68626D,Meadville,PA,41.611599,-80.114891A17494D,Allentown,PA,40.602658,-75.469236A86034S,Tonawanda,NY,42.99704,-78.878659A45142D,Asheville,NC,35.602711,-82.567281A38298S,Atlanta,GA,33.844371,-84.47405A14497Y,Roswell,GA,34.055198,-84.370475A25954D,Austin,TX,30.326374,-97.771258B46374X,Fairhope,AL,30.480713,-87.861306B52199S,Cedar…
arrow_forward
Merge DataFrames df1 and df2
import numpy as npimport pandas as pddf1 = pd.DataFrame({'lkey': ['faa', 'baa', 'bzz', 'faa'], 'value': [2, 3, 5, 7]})df2 = pd.DataFrame({'rkey': ['faa', 'baa', 'bzz', 'faa'], 'value': [7, 8, 9, 10]})#TO DO -- Complete the Code
arrow_forward
List is a mutable data type
a.
True
b.
False
Clear my choice
arrow_forward
The file LabChapter7Problem3.txt has 100 records and is formatted as follows:
Emp ID
Title
First Name
Middle Initial
Last Name
Mother's Maiden Name
Age in Yrs.
Create a Structure with the file’s information: Employee Number, Title, First Name, Middle Initial, Last Name, Mother’s Maiden Name and Age. Sort the Structure through ascending values of the Age variable using the Enhanced Bubble Sort Algorithm
Show on screen sorted records 55-65 and create a new file with all sorted records called LabChapter7Problem3SortedRecords.txt.
Use the following format for both the screen output and the file created:
------------------------------------------------------------------
| Employee Number | Full Name | Age |
------------------------------------------------------------------
| 123456 | Mr. Ranma P Saotome Tendo | 21 |
------------------------------------------------------------------
| 654321 | Mr. Goku A Son Kakarot…
arrow_forward
Integer num_raw is read from input, representing the number of integers to be read next. Read the remaining integers from input and insert each integer at the front of raw_list at position 0.
arrow_forward
Applied data science. Python
arrow_forward
Assume the pointer variable headPtr points to a linked list of 20 Nades. Explain the logic
error that occurs when the following statement is executed:
headPtr = new Node;
Edit View Insert
Format Tools Table
12pt
Paragraph
BIUA e Tv.
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
- Q4:arrow_forwardx: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20] y: [21, 22, 23, 24, 25, 26, 27, 28, 29, 30] z: [31, 32, 33, 34, 35, 36, 37, 38, 39, 40] Use the dic1 in item a to create a dictionary (dic3) of key “mlt” where the corresponding indices of x, y, and z keys of dic1 are multiplied. dic3 is expected to be as follows: dic3 = {mlt: [11*21*31, 12*22*32, 13*23*33,...]}Pythonarrow_forwardAttach File Browse My Computer QUESTION 2 - use Eclipse to create a project. create a new class containing a main function. - Create a function describing the bubble sort to sort a LinkedList of Integers in the decreasing order (from the largest number to the smallest number). The function should accept a LinkedList and returm a LinkedLlist. Add also statements to trace the progress of bubble sort to display the LinkedList contents after each exchange. The main function should contain at least two test examples of the bubble sort function that you have create on various ordered and random LinkedList of Integers. NB: Send only the Java file containing your work. If the program dose not compile, marks will be reduced. if the program dose not properly as described above, marks will be reduced. Attach File Browse My Computer Click Save and Submit to save and submit. Click Save All Answers to save all answers. XI 門arrow_forward
- Consider the following list: L = ['bran', 'tyrion', 'jon', 'sansa', 'drogon', 'ned', 'arya', 'ghost'] In the table below, show the contents of the list after each of the first three iterations of the outer while-loop in merge_sortarrow_forwardPYTHON prov_records_per_date() takes a 2-D list (similar to the database) and an integer representing the province ID. This function returns another 2-D list, where each element of this list stores information in the following format. [ [day1, total number of patients (both icu and non-icu) in this provice reported in day1], [day2, total number of patients (both icu and non-icu) in this provice reported in day2], ... ] >>> results = prov_records_per_date(database, 35) >>> display_dict(result) >>> display_list(result) ['2022-01-31', 239] ['2022-02-05', 393] >>> results = prov_records_per_date(database, 10) >>> display_dict(result)['2022-02-02', 225] >>> results = prov_records_per_date(database, 81) >>> display_dict(result)No data in listarrow_forwardPARTS file with Part# as the hash key (K) includes records with the following Part# values:2360, 3760, 5232, 4692, 4871, 2659, 1821, 3074, 7115, 1620, 2428, 1943, 4750, 2975, 4981, 1111, 3123, 3211, 5654, and 2208. The hash file has 30 cells , numbered 0 to 29. Eachcell holds one record. Calculate the average search length for searching all entries.arrow_forward
- 1211] - Read-Only - Word O Search References Mailings Review View Help 20 - Hash index entries are assigned to. a) Values b) Clusters c) Buckets d) Blocks 21 - what are the index of an efficient bitmaps index? a) Each bucket has initially one block. Any additional blocks are allocated and linked to an initial block b) The WHERE clause may specify any values in upper ways. The column used in a WHERE clause may contain mixed upper- and lower-case characters. c) The database can quickly determine the block containing a table row from the index row mumber. Any indexed column relatively few distinct values. d) Indexes change only when primary key values are updated. physical indexes change whenever a row moves to a new block. 22 - A column contains grades from 0 to 10, but uh where clause specifies values from 0 to 100. A. index can be used to modify the column values and process the queries. a) Multi - level b) logical c) single - level d) function 23 - In logical index, pointers to table…arrow_forwardComputer Science Find all files that are larger than 20MB, redirect list to BigFileList.txt.Find all files that have update time in last one week, redirect list to UpdatedFileInLastWeek.txt.arrow_forward2. Each student at Middlesex County College takes a different number of courses, so the registrar has decided to use linear linked lists to store each student's class schedule and an array to represent the entire student body. A portion of this data structure is shown below: link Sec cr CSC16213 →HISHO 24 $||1|| 1/1234 2/2 357 CSC236/4 37 These data show that the first student (ID: 1111) is taking section 1 of CSC162 for 3 credits and section 2 of HIS101 for 4 credits; the second student is not enrolled; the third student is enrolled in CSC236 section 4 for 3 credits. s Write a class for this data structure. Provide methods for creating the original array, inserting a student's initial class schedule, adding a course, and dropping a course. Include a menu-driven program that uses the class.arrow_forward
- List data_list contains integers read from input, representing a sequence of data values. For each index i of data_list from 1 through the second-to-last index: The element at index i is a drop if the element is less than both the preceding element and the following element. If the element at index i is a drop, then output 'Drop: ', followed by the preceding element, the current element, and the following element, separating each element by a space.arrow_forward↓ 11₁ may be removed, but a new item could be added right after the existin Sample output from startup code Output - ICA01_Start (run) X e 32 E 9 ·9:-V EE/-T/-E CPS 151 ICA 1 by Enter the maximum size: 15 Enter the starting size: 8 Original List 100 101 102 103 104 105 106 107 Position to delete from: 5 Invalid delete position, no changes made Value to insert: 999 At what position? 3 Invalid insert position, no changes made Final List 100 101 102 103 104 105 106 107 Goodbye BUILD SUCCESSFUL (total time: 27 seconds) 5 ENG Earrow_forwardchoose the correct answer An application requires to maintain the history of past events. the best data structure is: a. Linked List with History b. Queue c. Stack d. Linked List An application requires frequent insertion and deletion of data. The data to be inserted is large. Which data structure you will choose? a. Array b. Stack c. Linked List d. queue An application requires strict ordering of jobs to be processed on a first-come-first-served basis. Which data structure you will choose? inked List b. Double Linked List c. Stack d. Queue Consider a linked List with just one node. The first node in the list is referred by 'head'. Now, if we execute the code: head=head.next What will happen? a. Another 'head' is assigned to the first node b. head points to the last node which is not null c. head points to the next node which is not null d. We lose the…arrow_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