CS5343 Dec 7, 2021 - Set 1
.docx
keyboard_arrow_up
School
University of Texas, Dallas *
*We aren’t endorsed by this school
Course
5343
Subject
Computer Science
Date
Feb 20, 2024
Type
docx
Pages
10
Uploaded by MasterRhinoceros3614
CS5343 Algorithms and Data Structures
Exam-2 Dec 7, 2021
Please write using PEN
First Name:__________________________ Last Name: ______________________________
Student #:________________________
1.
(10 points) You are given a single linked list. The list has at least 3 nodes. The number of nodes in the list is odd. Write a recursive algorithm to find the middle node. You can only traverse the list once, so you cannot count the number of nodes in the list. Your function can have up to 2 arguments (not more). You cannot use global variables or static variables. Also do not modify the list structure. You may write the main function
start the recursive function. Then write the recursive function. The list is defined as follows:
Node {
Int val;
Node *next;
}
Main() {
Mid( ………………………. );
Mid( tmp1, tmp2 ) {
2.
(10 points) Binary tree node is defined as follows:
Node {
Int Val;
Node *rchild;
Node *lchild;
}
You are given a binary tree. Write a recursive algorithm that would return the mirror image of the tree. Do not use any more arguments or global variables. Mirror (root1, root2 ) {
3.
(10 points) In a directed graph, give the algorithm to determine if the graph is strongly connected or weakly connected.
4.
The following is a red-black tree. (10 points)
a.
Delete the node 17 and then 18. Show the steps and the final tree after deletions.
b.
In the following tree insert 22 and then 24. Show the steps and the final tree after insert
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
4
DO NOT COPY FROM OTHER WEBSITES
Correct and detailed answer will be Upvoted else downvoted. Thank you!
arrow_forward
2. Correct and detailed answer will be Upvoted else downvoted. Thank you!
arrow_forward
Solve Question 36, 37 showing detailly all the steps with including all explanations
Answer Should be typewritten using a computer keyboard!
arrow_forward
Java Programming Language
DSA
Don't use built in libraries.
We want to build an address book that is capable of storing name, address & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from application
arrow_forward
Arrays provide what advantages? An array may have as many dimensions as it can handle. What is the difference between a structure and a simple kind of parameter? It would be helpful to see an example of a complex data structure.
arrow_forward
In Visual Basics,
ANTIQUE CAR COMPETITION DATABASE
Design a Windows Application and write the code that will execute
according to the program requirement below :
____________________________________________________________________________________________________
(i) The user views the Access database, which displays the car year model, and owner information.
(ii) The user clicks the Add new button to add a new car and clicks the Save data button to save the item
to the database.
(iii) The user clicks the Delete button to delete a car, and permanently deletes the record from the database
by clicking the Delete data button.
arrow_forward
c++
We want to build an address book that is capable of storing name, address, Birthday, Email & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from application
arrow_forward
This lab addresses the following major topics:
• 2d arrays
Vectors, array of vectors
Input/output files
• Introduction of Structures
You will find the instruction file along with any additional files on blackboard.
In this category of lab activity students are expected to write a complete program during the lab
and submit the compiling program on blackboard before the end of the lab session.
.
.
The instructor will give a brief description of the assignment and provides limited help
throughout the lab. Students can use the textbook, class notes or sample programs to complete
the assignment, but are PROHIBITED from collaborating with one another.
Requirements for the program:
This lab assignment has 4 parts, for grading purposes, separate each part in your program using a
comment line such as:
Part I:
In an input file called inData. txt, we have 6 lines of data in the following pattern per line:
One-word name of a student followed by 5 assignment scores (all integers).
An example of…
arrow_forward
Python please
arrow_forward
Q# 2:
Case Study 01:
Students of biology department are performing lab task over a digital device which was
developed by a project under Bioinformatics department, during this activity they are
required to monitor/write each numerical readings manually from their experiments
and patients records too. In an interview a biology student said that, "Analysis can be
done if we have 100 readings for three particular tests".
1. Blood Pressure
2. Cholesterol
3. Chest Pain Type
Table 1: Sample data (for understanding)
Object
Name
Blood Cholesterol Chest
pressure in mg/dl
Age Sex
ID
pain
type
Konrad Black 31 | male
Anna White 56 female 120.0
130.0
331.2
45.0
1
5
According to case study 01, what is the data structure you will recommend to handle
these kind of data, explain your answer with authentic arguments?
b. To make working simple for biology students, how do you help them in Analysis
process?
C.
Demonstrate your answers of part (a) and (b) by designing of Algorithm.
arrow_forward
Solve Question33, 34, 35 showing detailly all the steps with including all explanations
Answer Should be typewritten using a computer keyboard!
arrow_forward
Arrays provide what advantages? An array may have a maximum number of dimensions of When it comes to variables, what separates them from a basic kind of structure? It would be helpful to see an example of a complex data structure.
arrow_forward
What are the benefits of arrays? The maximum number of dimensions that an array may contain is. How are structures different from simple variables? An example of a more complex data structure would be helpful for understanding.
arrow_forward
Pls help java to mysql (search from database)
arrow_forward
Utility program used for?
data addressing
storing data
uninstalling programs
processing data
arrow_forward
SUPPLIER
PRODUCT
ProductCode
ProductnName
unitPrice
SupCode
supCode
(Number, 3)
SupName
(text, 20)
АВC LLC
(Number, 10)
[Char(10)]
(>0)
1111111
Calculator
10
111
111
2222222
Notebook
2.5
777
222
ХҮX LLC
3333333
Book-AI
20
222
3333
PQR LLC
4444444
Pen
-2.0
222
222
AXL LLC
5555555
Pencil
.500
111
Eraser
.500
222
arrow_forward
When it comes to data encapsulation, what are your thoughts? Elaborate.
arrow_forward
a data structure that stores an ordered list of items, where each item is directly accessible by a positional index
a data structure that stores an ordered list of items in nodes, where each node stores data and has a pointer to the next node
a data structure in which each node stores data and has up to two children, known as a left child and a right child
a data structure that stores unordered items by mapping each item to a location in an array
a data structure for representing connections among items, and consists of vertices connected by edges
Graph, binary tree, hash table, array, linked list. Assign each term to its definition please
arrow_forward
Computer science
Short answer
-What do you think about data hiding, data encapsulation and data binding?
arrow_forward
What are the benefits associated with using arrays? The most dimensions that may be
included in a single array is. What is it that differentiates a structure from a regular variable? It
would be helpful if you could provide an example of a complicated data structure.
arrow_forward
Why are algorithms taken into account while creating Data Structures?
arrow_forward
DONT COPY FROM OTHER CHEGG ANSWERS OR COPY UNRELATED ANSWERS FROM GOOGLE OR I WILL REPORT YOU!! ANSWER ONLY IF YOU'RE AN EXPERT
Please provide the code or pseudocode of phrase search in Java or C programming language, you can use any index algorithm.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- 4 DO NOT COPY FROM OTHER WEBSITES Correct and detailed answer will be Upvoted else downvoted. Thank you!arrow_forward2. Correct and detailed answer will be Upvoted else downvoted. Thank you!arrow_forwardSolve Question 36, 37 showing detailly all the steps with including all explanations Answer Should be typewritten using a computer keyboard!arrow_forward
- Java Programming Language DSA Don't use built in libraries. We want to build an address book that is capable of storing name, address & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from applicationarrow_forwardArrays provide what advantages? An array may have as many dimensions as it can handle. What is the difference between a structure and a simple kind of parameter? It would be helpful to see an example of a complex data structure.arrow_forwardIn Visual Basics, ANTIQUE CAR COMPETITION DATABASE Design a Windows Application and write the code that will execute according to the program requirement below : ____________________________________________________________________________________________________ (i) The user views the Access database, which displays the car year model, and owner information. (ii) The user clicks the Add new button to add a new car and clicks the Save data button to save the item to the database. (iii) The user clicks the Delete button to delete a car, and permanently deletes the record from the database by clicking the Delete data button.arrow_forward
- c++ We want to build an address book that is capable of storing name, address, Birthday, Email & phone number ofa person. Address book provides functionality in the form of a menu. The feature list includes:• Add – to add a new person record• Delete – to delete an existing person record by name• Search – to search a person record by name· Exit – to exit from applicationarrow_forwardThis lab addresses the following major topics: • 2d arrays Vectors, array of vectors Input/output files • Introduction of Structures You will find the instruction file along with any additional files on blackboard. In this category of lab activity students are expected to write a complete program during the lab and submit the compiling program on blackboard before the end of the lab session. . . The instructor will give a brief description of the assignment and provides limited help throughout the lab. Students can use the textbook, class notes or sample programs to complete the assignment, but are PROHIBITED from collaborating with one another. Requirements for the program: This lab assignment has 4 parts, for grading purposes, separate each part in your program using a comment line such as: Part I: In an input file called inData. txt, we have 6 lines of data in the following pattern per line: One-word name of a student followed by 5 assignment scores (all integers). An example of…arrow_forwardPython pleasearrow_forward
- Q# 2: Case Study 01: Students of biology department are performing lab task over a digital device which was developed by a project under Bioinformatics department, during this activity they are required to monitor/write each numerical readings manually from their experiments and patients records too. In an interview a biology student said that, "Analysis can be done if we have 100 readings for three particular tests". 1. Blood Pressure 2. Cholesterol 3. Chest Pain Type Table 1: Sample data (for understanding) Object Name Blood Cholesterol Chest pressure in mg/dl Age Sex ID pain type Konrad Black 31 | male Anna White 56 female 120.0 130.0 331.2 45.0 1 5 According to case study 01, what is the data structure you will recommend to handle these kind of data, explain your answer with authentic arguments? b. To make working simple for biology students, how do you help them in Analysis process? C. Demonstrate your answers of part (a) and (b) by designing of Algorithm.arrow_forwardSolve Question33, 34, 35 showing detailly all the steps with including all explanations Answer Should be typewritten using a computer keyboard!arrow_forwardArrays provide what advantages? An array may have a maximum number of dimensions of When it comes to variables, what separates them from a basic kind of structure? It would be helpful to see an example of a complex data structure.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning