CS5343 - Mid Term - Spring 2021
.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
7
Uploaded by MasterRhinoceros3614
CS5343 Algorithms and Data Structures
Midterm Exam – Apr 1, 2021
First Name:______RAGAVALLI_________________ Last Name:_____OMMI____________________________
Student #:___2021513479_____________________
1.
The node of a list is:
Node { Int val;
Node *next;
Node *prev;
}
Node *head;
Node *tail;
(10 points) Write an algorithm to delete a Node n in the list. Node n could be the head or the tail node or a node between head and tail. The list may contain only one
node, so after deletion it will be empty. Head and tail are global variables. Do not use any other static or global variables. Do not add any arguments to the function, except the ones already given.
deleteNode( Node *n ) {
}
2.
Write an Append() Algorithm that takes two single-linked lists, 'a' and 'b', appends 'b' onto the end of 'a'. You are given the head pointer of each list. (15 points)
Class Node {
Int data;
Node *next
};
Main() {
Append(heada, headb) {
}
Append( tmp1, tmp2 ) {
}
3.
Given a binary tree. Some internal nodes of the tree have two children and some internal nodes have only one child. Write an algorithm that will count the number of nodes that have exactly two children. No global variables and no new arguments to the function.(15 points) Node {
Int val;
Node *lchild;
Node *rchild;
};
Main() {
Int n = count(root);
}
Int count(tmp) {
}
4.
Answer the following: (6 points)
a.
What is the big O of bubble sort
b.
Give an example of sequence of numbers where bubble sort has better Big O than selection sort.
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
What is the role of data structures and algorithms in computer science, and how can choosing the right data structure and algorithm improve the efficiency and performance of a software application?
arrow_forward
What are the fundamental data structures used in computer science, and how do they enable efficient processing and manipulation of large amounts of data in various applications and algorithms?
arrow_forward
use c language Compilation Build a Web Server that serves things
create a simple blog site
○ Users
■ Id
■ Email
■ Name
○ Posts
■ Id
■ User_id
■ Title
■ Body
■ Status (visible, hidden)
Part 1
○ Create the database for this and do select, insert, delete from stdin (user enters operation and
data)
arrow_forward
Does data deletion algorithm affect Symbian, Android, or iPhone operating systems?
arrow_forward
What are the fundamental data structures used in computer science, and how does their choice impact the efficiency and performance of various algorithms and operations?
arrow_forward
How do caching mechanisms improve computational efficiency?
arrow_forward
BASE SAS PROGRAMMING
Question 12:- When a SAS data set is created from a spreadsheet, the spreadsheet column headings are always stored as which of the following?
a) variable names
b) labels
c) formats
d) descriptor
Question 13:- In SAS, one can test single or joint hypothesis after successful completion of
a) Data portion
b) First observation
c) Descriptor portion
d) PDV
Question 14:- The following SAS program is submitted: data work.products; Product_Number = 5461; Item = `1001`; Item_Reference = Item`/`Product_Number; run; Which one of the following is the value of the variable ITEM_REFERENCE in the output data set?
a) 1111/1502
b) 1001/ 5461
c) (missing numeric value)
d) The value can not be…
arrow_forward
What are some advanced use cases for dictionaries, such as using nested dictionaries for complex data structures or creating a dictionary-based cache system? Provide examples and explain their advantages.
arrow_forward
Utility program used for?
data addressing
storing data
uninstalling programs
processing data
arrow_forward
What Advantages Does Data Cleaning Provide to the Computer Science Community?
arrow_forward
What's the difference between normalising and denormalizing data in computer science?
arrow_forward
What are the Uses for Data Structures and Algorithms?
arrow_forward
How may quantum computing change the world of code development?
arrow_forward
Discuss the role of a compiler in code scheduling.
arrow_forward
Write script using matlab please
arrow_forward
How does the proper utilization of data structures enhance the efficiency of algorithms and program execution, and what role do they play in optimizing memory utilization?
arrow_forward
Computer science What is View Resolution and View Materialization?
arrow_forward
What Benefits Does Data Cleaning Offer the Computer Science Community?
arrow_forward
What is meant by the phrase "application metadata"? an introduction to the field of computer science
arrow_forward
Discuss the challenges of debugging and profiling multithreaded applications. What tools and techniques can be used to address these challenges?
arrow_forward
Data Structures and Algorithms
how would you be defining the following with proper examples?
i. Fieldii. Merge Operationiii. Fileiv. Physical data Structures
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Related Questions
- What is the role of data structures and algorithms in computer science, and how can choosing the right data structure and algorithm improve the efficiency and performance of a software application?arrow_forwardWhat are the fundamental data structures used in computer science, and how do they enable efficient processing and manipulation of large amounts of data in various applications and algorithms?arrow_forwarduse c language Compilation Build a Web Server that serves things create a simple blog site ○ Users ■ Id ■ Email ■ Name ○ Posts ■ Id ■ User_id ■ Title ■ Body ■ Status (visible, hidden) Part 1 ○ Create the database for this and do select, insert, delete from stdin (user enters operation and data)arrow_forward
- Does data deletion algorithm affect Symbian, Android, or iPhone operating systems?arrow_forwardWhat are the fundamental data structures used in computer science, and how does their choice impact the efficiency and performance of various algorithms and operations?arrow_forwardHow do caching mechanisms improve computational efficiency?arrow_forward
- BASE SAS PROGRAMMING Question 12:- When a SAS data set is created from a spreadsheet, the spreadsheet column headings are always stored as which of the following? a) variable names b) labels c) formats d) descriptor Question 13:- In SAS, one can test single or joint hypothesis after successful completion of a) Data portion b) First observation c) Descriptor portion d) PDV Question 14:- The following SAS program is submitted: data work.products; Product_Number = 5461; Item = `1001`; Item_Reference = Item`/`Product_Number; run; Which one of the following is the value of the variable ITEM_REFERENCE in the output data set? a) 1111/1502 b) 1001/ 5461 c) (missing numeric value) d) The value can not be…arrow_forwardWhat are some advanced use cases for dictionaries, such as using nested dictionaries for complex data structures or creating a dictionary-based cache system? Provide examples and explain their advantages.arrow_forwardUtility program used for? data addressing storing data uninstalling programs processing dataarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Principles of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
Principles of Information Systems (MindTap Course...
Computer Science
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning