91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫CS 211、Python/c++設計程序代做

時間:2024-02-12  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



CS 211: Computer Architecture, Spring 2024
Programming Assignment 1: Introduction to C (50 points)
Instructor: Prof. Santosh Nagarakatte
Due: February 9, 2024 at 5pm Eastern Time.
Introduction
The goal of this assignment is to get you started with programming in C, as well as compiling,
linking, running, and debugging. Your task is to write 5 small C programs. Your program must
follow the input-output guidelines listed in each section exactly, with no additional or missing
output. You can assume that we will provide well-defined test cases.
No cheating or copying will be tolerated in this class. If you use any large language models (LLMs)
such as ChatGPT/Bard/LLama or other models and as a result, your code is similar to another
student’s code in the class, it will be considered a violation of academic integrity. You should not
be using large language models to copy-paste your code. Your assignments will be automatically
checked with plagiarism detection tools that are pretty powerful. Hence, you should not look at your
friend’s code or copy-paste any code from LLMs or the Internet. See CS department’s academic
integrity policy at:
http://academicintegrity.rutgers.edu/
First: Is the Input a Product of 2 or 3 Given Numbers? (5 Points)
You have to write a program that given an array of integers determines if a particular integer input
being queried is a product of 2 or 3 numbers in the array. If it is such a product, then you have to
output yes. Otherwise, you will output no.
Input-Output format: Your program will take the file name as input. The first line in the input
file provides the total number of integers in the input array. The next line will provide the list of
these input integers. The third line in the input file provides the number of inputs queried. The
subsequent lines are the queries that will the provide the specific input and the number 2 or 3. For
example, if you have a query line of the form: 21 2, then you are checking if 21 is a product of 2
numbers from the input integer array. If so, output yes.
Here is a sample input file. Let us call file1.txt
5
3 7 8 11 17
4
21 2
12 2
1309 3
15 3
1
In the above file, the input array has 5 integers whose entries are 3, 7, 8, 11, and 17 respectively.
There are 4 queries being done. The first query asks if 21 is a product of 2 integers in the array.
The output is yes because 21 = 3 ∗ 7. In contrast, the answer is no for the query: 12 2. This is
because 12 is not a product of any two integers in the input array.
Your output will contain the same number of lines as the number of query lines in the input file.
Each line will either say yes if the corresponding input in the query is a product of the specified
numbers or no if the corresponding input is not a product of the specified numbers.
The sample execution is as shown.
$./first file1.txt
yes
no
yes
no
We will not give you improperly formatted files. You can assume that the files exist and all the
input files are in proper format as above. See the submission organization format at the end of the
assignment for more details.
Second: Ordered Linked List (10 points)
In this part, you have to implement a linked list that maintains a list of integers in sorted order.
For example, if a list already contains 2, 5 and 8, then 1 will be inserted at the start of the list, 3
will be inserted between 2 and 5 and 10 will be inserted at the end.
Input format: This program takes a file name as an argument from the command line. The file
contains successive lines of input. Each line contains a string, either INSERT or DELETE, followed
by a space and then an integer. For each of the lines that starts with INSERT, your program should
insert that number in the linked list in sorted order if it is not already there. Your program should
not insert any duplicate values. If the line starts with a DELETE, your program should delete the
value if it is present in the linked list. Your program should silently ignore the line if the requested
value is not present in the linked list. After every INSERT and DELETE, your program should print
the content of the linked list. The values should be printed in a single line separated by a single
space. There should be no leading or trailing white spaces in each line of the output. You should
print EMPTY if the linked list is empty.
Output format: At the end of the execution, your program should have printed the content of
the linked list after each INSERT or DELETE operation. Each time the content is printed, the values
should be on a single line separated by a single space. There should be no leading or trailing white
spaces in each line of the output.You should print EMPTY if the linked list is empty. You can assume
that there will be at least one INSERT or DELETE in each file.
2
Example Execution:
Lets assume we have 2 text files with the following contents:
file1.txt:
INSERT 1
INSERT 2
DELETE 1
INSERT 3
INSERT 4
DELETE 4
INSERT 5
DELETE 5
file2.txt:
INSERT 1
DELETE 1
INSERT 2
DELETE 2
INSERT 3
DELETE 3
INSERT 4
DELETE 4
INSERT 5
DELETE 5
Then the result will be:
$./second file1.txt
1
1 2
2
2 3
2 3 4
2 3
2 3 5
2 3
$./first file2.txt
1
EMPTY
2
EMPTY
3
EMPTY
4
EMPTY
5
EMPTY
3
Third: Matrix Exponentiation (10 points)
This program will test your ability to manage memory using malloc() and provide some experience
dealing with 2D arrays in C. Your task is to create a program that computes Mn where M is a
square matrix (the dimensions of the matrix will be k × k where k is the number of rows) and a
number n ≥ 0. In summary, you need to multiply the matrix with itself n times.
Input format: The program will take the file name as input. The first line in the file will provide
the number of rows in the matrix. The subsequent lines will provide the contents of the matrix.
The numbers are tab separated. The last line in the file after the contents of the matrix will contain
the exponent n. For example, a sample input file “file.txt”:
3
1 2 3
4 5 6
7 8 9
2
The first number (3) refers to the number of rows in the square matrix. The dimensions of the
matrix will be 3 × 3. The exponent is 2. Hence, the program is required to compute M2
. You can
assume that the input will be properly formatted. The output on executing the program with the
above input is shown below. The output numbers should be tab separated. There should not be
extra tabs or spaces at the end of the line or the end of the file.
30 36 42
66 81 96
102 126 150
Fourth: Binary Search Tree (10 Points)
You have to implement a binary search tree. The tree must satisfy the binary search tree property:
the key in each node must be greater than all keys stored in the left sub-tree, and smaller than all
keys in right sub-tree. You have to dynamically allocate space for each node and free the space for
the nodes at the end of the program.
Input format: This program takes a file name as an argument from the command line. The file
is either blank or contains successive lines of input. Each line starts with a character, either i’ or
’s’, followed by a tab and then an integer. For each line that starts with ’i’, your program should
insert that number in the binary search tree if it is not already there. If it is already present, you
will print ”duplicate” and not change the tree. If the line starts with a ’s’, your program should
search for the value.
Output format: For each line in the input file, your program should print the status/result of
the operation. For an insert operation, the program should print either “inserted” with a single
space followed by a number, the height of the inserted node in the tree, or ”duplicate” if the value
4
is already present in the tree. The height of the root node is 1. For a search, the program should
either print ‘’present”, followed by the height of the node, or “absent” based on the outcome of the
search.
Example Execution: Lets assume we have a file file1.txt with the following contents:
i 5
i 3
i 4
i 1
i 6
s 1
Executing the program in the following fashion should produce the output shown below:
$./eighth file1.txt
inserted 1
inserted 2
inserted 3
inserted 3
inserted 2
present 3
Fifth: Matrix Determinant(15 points)
In linear algebra, the determinant is a value that can be computed with a square matrix. The
determinant describes some properties about the square matrix. Determinants are used for solving
linear equations, computing inverses, etc, and is an important concept in linear algebra. In the
fifth part of the assignment, you will write a program that computes the determinant of any n × n
matrix. You will have to carefully manage malloc and free instructions to successfully compute
the determinants.
Determinant
Given a square n × n matrix M, we will symbolize the determinant of M as Det(M). You can
compute Det(M) as follows:
1×1 matrix The determinant of the 1 ×1 matrix is the value of the element itself. For example,
Det(

3

) = 3
2 × 2 matrix The determinant of a 2 × 2 matrix can be computed using the following formula:
Det(

a b
c d
) = ad − bc
5
For example,
Det(

1 2
3 4
) = 1 × 4 − 2 × 3 = 4 − 6 = −2
3 × 3 matrix The determinant of a 3 × 3 matrix can be computed modularly. First, let’s define
a 3 × 3 matrix:
M =


a b c
d e f
g h i
?**7;
?**9;
The formula for computing the determinant of M is as follows:
Det(M) = a × Det(Ma) − b × Det(Mb) + c × Det(Mc)
The matrix Ma is a 2 × 2 matrix that can be obtained by eliminating the row and column that a
belongs to in M. More specifically, since a is on the first row and first column, we eliminate the
first row and first column from M:

n×n matrix Computing the determinant of an n×n matrix can be considered as a scaled version
of computing the determinant of a 3 × 3 matrix. First, let’s say we’re given an n × n matrix,

Finally, you can compute the determinant of M using the following formula:
Det(M) = x1,1×Det(M1,1)−x1,2×Det(M1,2)+x1,3×Det(M1,3)−x1,4×Det(M1,4)+x1,5×Det(M1,5). . .
7
The above formula can be shortened to the following formula:
Det(M) = Σn
i=1(−1)i−1x1,i × Det(M1,i)
This general formula for computing the determinant of n × n matrix applies to all n. The formula
for computing the determinant of 2 × 2 and 3 × 3 matrix is exactly the same as this formula.
Input-Output format:
Your program should accept a file as command line input. The format of a sample file test3.txt
is shown below:
3
2 7 6
9 5 1
4 3 8
The first number (3) corresponds to the size of the square matrix (n). The dimensions of the matrix
will be n x n. You can assume that n will not be greater than 20. The rest of the file contains the
content of the matrix. Each line contains a row of the matrix, where each element is separated by
a tab. You can assume that there will be no malformed input and the matrices will always contain
valid integers.
Your program should output the determinant of the n × n matrix provided by the file.
Example Execution
A sample execution with above input file test3.txt is shown below:
$./fifth test3.txt
-360
Structure of your submission folder
All files must be included in the pa1 folder. The pa1 directory in your tar file must contain 5
subdirectories, one each for each of the parts. The name of the directories should be named first
through fifth (in lower case). Each directory should contain a c source file, a header file (if you
use it) and a Makefile. For example, the subdirectory first will contain, first.c, first.h (if you create
one) and Makefile (the names are case sensitive).
pa1
|- first
|-- first.c
|-- first.h (if used)
|-- Makefile
|- second
|-- second.c
|-- second.h (if used)
8
|-- Makefile
|- third
|-- third.c
|-- third.h (if used)
|-- Makefile
|- fourth
|-- fourth.c
|-- fourth.h (if used)
|-- Makefile
|- fifth
|-- fifth.c
|-- fifth.h (if used)
|-- Makefile
Submission
You have to e-submit the assignment using Canvas. Your submission should be a tar file named
pa1.tar. To create this file, put everything that you are submitting into a directory (folder)
named pa1. Then, cd into the directory containing pa1 (that is, pa1’s parent directory) and run
the following command:
tar cvf pa1.tar pa1
To check that you have correctly created the tar file, you should copy it (pa1.tar) into an empty
directory and run the following command:
tar xvf pa1.tar
This should create a directory named pa1 in the (previously) empty directory.
The pa1 directory in your tar file must contain 5 subdirectories, one each for each of the parts.
The name of the directories should be named first through fifth (in lower case). Each directory
should contain a c source file, a header file and a make file. For example, the subdirectory first will
contain, first.c, first.h and Makefile (the names are case sensitive).
AutoGrader
We provide a custom autograder to test your assignment. The custom autograder is provided as
pa1 autograder.tar. Executing the following command will create the autograder folder.
$tar xvf pa1_autograder.tar
There are two modes available for testing your assignment with the custom autograder
9
First mode
Testing when you are writing code with a pa1 folder
(1) Lets say you have a pa1 folder with the directory structure as described in the assignment.
(2) Copy the folder to the directory of the autograder (i.e., pa1 autograder)
(3) Run the custom autograder with the following command
$python3 pa1 autograder.py
It will run your programs and print your scores.
Second mode
This mode is to test your final submission (i.e, pa1.tar)
(1) Copy pa1.tar to the pa1 autograder directory
(2) Run the autograder with pa1.tar as the argument.
The command line is
$python3 pa1 autograder.py pa1.tar
Scoring
The autograder will print out information about the compilation and the testing process. At the
end, if your assignment is completely correct, the score will something similar to what is given
below.
You scored
5.0 in second
5.0 in fourth
5.0 in third
7.5 in fifth
2.5 in first
Your TOTAL SCORE = 25.0 /25
Your assignment will be graded for another 25 points with test cases not given to you
Grading Guidelines
This is a large class so that necessarily the most significant part of your grade will be based on
programmatic checking of your program. That is, we will build the binary using the Makefile and
source code that you submitted, and then test the binary for correct functionality against a set of
inputs. Thus:
• You should not see or use your friend’s code either partially or fully. We will run
state of the art plagiarism detectors. We will report everything caught by the
tool to Office of Student Conduct.
10
• You should make sure that we can build your program by just running make.
• Your compilation command with gcc should include the following flags: -Wall -Werror
-fsanitize=address,undefined -g
• You should test your code as thoroughly as you can. For example, programs should not crash
with memory errors.
• Your program should produce the output following the example format shown in previous
sections. Any variation in the output format can result in up to 100% penalty. Be
especially careful to not add extra whitespace or newlines. That means you will probably not
get any credit if you forgot to comment out some debugging message.
• Your folder names in the path should have not have any spaces. Autograder will
not work if any of the folder names have spaces.
Be careful to follow all instructions. If something doesn’t seem right, ask on discussion forum.
如有需要,請加QQ:99515681 或WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:COMP 636代做、代寫SQL編程設計
  • 下一篇:PROG10065代寫、代做C++語言編程
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    久久久久免费| 亚洲色图欧美在线| 欧美二区三区91| 精品视频999| 欧美另类一区二区三区| 欧美日韩激情在线| 91精品国产aⅴ一区二区| 91精品久久久久久久99蜜桃| 日韩一级在线观看| 久久久影视传媒| 国产精品久久久久国产精品日日| 国产精品入口麻豆九色| 亚洲欧洲综合另类在线| 亚洲3atv精品一区二区三区| 视频在线观看一区| 精品一区二区三区在线播放| 国产福利精品一区| 99久久免费精品| 亚洲国产日韩欧美| 久久综合九九| 在线播放/欧美激情| 久久综合久久综合亚洲| 国产精品免费视频一区| 亚洲观看高清完整版在线观看| 日韩成人午夜精品| 福利电影一区二区三区| 欧美成人69| 久久午夜影视| 日韩手机在线导航| 中文字幕一区二区日韩精品绯色| 亚洲自拍偷拍av| 国产精品一区一区| 欧美系列一区| 在线视频国内一区二区| 精品欧美黑人一区二区三区| 日韩毛片精品高清免费| 乱中年女人伦av一区二区| 成人综合在线视频| 国产视频一区免费看| 欧美日韩一区二区三区四区五区| 久久久久国产成人精品亚洲午夜| 亚洲人吸女人奶水| 国内精品国产三级国产a久久| 91麻豆成人久久精品二区三区| 一区二区三区久久网| 欧美电影一区二区| 亚洲精品videosex极品| 国产91在线看| 久久精品盗摄| 国产日韩欧美制服另类| 毛片av一区二区三区| 色综合色狠狠综合色| 在线观看日韩精品| 中文字幕中文字幕一区| 国产精品88av| 欧美一区=区| 久久精品亚洲精品国产欧美kt∨| 三级影片在线观看欧美日韩一区二区| aaa亚洲精品一二三区| 欧洲人成人精品| 国产精品动漫网站| 成人av在线影院| 在线观看国产91| 一区二区三区在线看| 91在线国内视频| 欧美日韩国产一级二级| 亚洲成人自拍偷拍| 亚洲亚洲精品三区日韩精品在线视频| 欧美日本不卡视频| 三级一区在线视频先锋| 91久久极品少妇xxxxⅹ软件| 久久色在线视频| 国产精品一级片在线观看| 久久久亚洲一区| 亚洲欧洲中文日韩久久av乱码| 93久久精品日日躁夜夜躁欧美| 欧美体内she精高潮| 午夜激情一区二区三区| 亚洲精选91| 国产精品热久久久久夜色精品三区| 国产v综合v亚洲欧| 欧美性色欧美a在线播放| 亚洲福中文字幕伊人影院| 亚洲一二区在线| 中文字幕乱码久久午夜不卡| 丁香六月久久综合狠狠色| 精品视频1区2区| 美女视频黄a大片欧美| 久久男女视频| 亚洲国产精品一区二区久久| 99亚洲伊人久久精品影院红桃| 欧美韩国日本不卡| 欧美日韩三区四区| 中文一区二区在线观看| 欧美一区高清| 国产精品欧美久久久久一区二区| 91免费观看视频在线| 久久精品亚洲麻豆av一区二区 | 亚洲国产另类精品专区| 一本色道久久综合| 亚洲综合一区二区| 久久不射网站| 青青草国产精品亚洲专区无| 日本高清不卡视频| 久久国产精品免费| 欧美一区二区福利在线| 成人av中文字幕| 欧美国产亚洲另类动漫| 激情另类综合| 亚洲国产欧美在线| 欧美伊人精品成人久久综合97 | 成人午夜精品在线| 久久久蜜桃精品| 禁久久精品乱码| 亚洲国产一区二区视频| 91久久精品一区二区| 久久激情五月婷婷| 日韩精品一区二区三区四区视频 | 香蕉久久夜色| 老司机精品视频导航| 91精品国产麻豆国产自产在线| 成人激情开心网| 国产精品久久精品日日| 亚洲视频导航| 久久成人免费日本黄色| 日韩一二三区视频| 欧美日韩一区二区三区在线观看免| 你懂的国产精品永久在线| 国产乱码精品一区二区三区忘忧草 | 欧美黄污视频| 亚洲国产成人va在线观看天堂| 久久综合婷婷| 国产a精品视频| 国产精品久久久久久亚洲毛片 | 好吊日精品视频| 五月天中文字幕一区二区| 91超碰这里只有精品国产| 99精品视频免费在线观看| 成人欧美一区二区三区1314| 色综合久久久久久久久| www.亚洲免费av| 亚洲自拍偷拍网站| 日韩欧美成人激情| av成人免费观看| 国产成人综合亚洲网站| 中文字幕一区二区三区在线不卡| 日本精品视频一区二区三区| 99精品视频一区| 日韩 欧美一区二区三区| 久久精品亚洲国产奇米99| 久久国产精品毛片| 91浏览器在线视频| 美女诱惑一区二区| 国产精品福利av| 制服丝袜日韩国产| 亚洲一区精品视频| 99综合影院在线| 日韩成人dvd| 亚洲天堂a在线| 欧美变态tickling挠脚心| 久久人人97超碰国产公开结果| 99久久伊人精品| 蜜桃视频在线观看一区| 中文字幕一区在线观看| 日韩欧美一区中文| 色美美综合视频| 亚洲国产婷婷香蕉久久久久久99| 国产一二三精品| 日韩在线a电影| 有码一区二区三区| 国产欧美一区二区精品性| 在线不卡免费欧美| 色综合久久久久久久| 亚洲国产网站| 欧美1区3d| 成人黄色av电影| 国产精品影视天天线| 日本大胆欧美人术艺术动态| 伊人开心综合网| 国产精品久久久久一区二区三区共| 日韩亚洲欧美在线| 欧美日韩三级在线| 在线一区二区三区做爰视频网站| 99人久久精品视频最新地址| 欧美激情四色| 欧美一区影院| 91偷拍与自偷拍精品| 成人免费看的视频| 国产91精品一区二区| 国产一区二区美女诱惑| 奇米777欧美一区二区| 无吗不卡中文字幕| 午夜精品久久久久久久久| 亚洲一区二区三区在线播放| 亚洲精品日韩一| 一区二区免费视频| 一区二区三区自拍| 亚洲成av人片一区二区| 亚洲第一二三四区| 亚洲国产你懂的|