[SOLVED] 代写 C data structure math Your task is to implement an abstract textbuffer data type that meets the given interface.

30 $

File Name: 代写_C_data_structure_math_Your_task_is_to_implement_an_abstract_textbuffer_data_type_that_meets_the_given_interface..zip
File Size: 1120.98 KB

SKU: 4811700776 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


Your task is to implement an abstract textbuffer data type that meets the given interface.
You will submit the C code implementing the textbuffer ADT (textbuffer.c).
This page describes the interface of the textbuffer ADT that you are to implement. For your implementation, download textbuffer.c below and implement the type struct textbuffer as well as all of the functions whose prototypes are given in the header file textbuffer.h. All your code should go in textbuffer.c, which you have to submit.
charIndex struct_matchNode columnNumber intshowLineNumbers dumpTB boolshowLineNumbers
testTextbuffer.c
textbuffer.ctextbuffer.h
searchTB testTextbuffer.c linesTB
addPrefixTB textbuffer.c
pasteTB
formRichText #
textbuffer.h
skraM gnitsetotuA ot skraM elytS morf skael yromem rof gnitset devoM “.gnihton seod ti ,esiwrehto – retcarahc laiceps a sa detaert eb ot ti rof enil taht no sretcarahc erom eb tsum ereht dna enil
a ni retcarahc tsrif eht eb tsum retcarahc
eht taht etoN” – rof noitacifiralc a deddA skram sunob tuoba noitacifiralc a deddA
htiw tnetsisnoc eb ot
ni sllac taht
rof tnemmoc eht detadpU ot enil a deddA rof snoitacifiralc deddA
dna stset etirw ot stneduts rof
ceps eht ot snoitacifiralc emos deddA fo elyts/gnittamrof devorpmI elif tset buts a deddA degnahC degnahC 1 ta trats syawla won srebmun eniL gnidaerfoorP
QAFotpmuJ noitacificepS noissimbuS
reffubtxeT
1 tnemngissA 1252PMOC
ot ot
ni
ni
QAF eht ot
rof noitacifiralc a deddA rebotcO dr3
QAF eht ot
rebotcO ht4
rebotcO dn2
rebotcO ts1 golegnahC

newTB newTB
diffTB
diffTB
abort
dumpTB
searchTB
NULL text
-O -g – diffTB
diffTB
cutTBpasteTB
The assignment is worth 10 marks. The mark breakdown is as follows:
Due to the bonus challenges, you could get up to 12 marks for the assignment. Any extra marks obtained during this assignment (in excess of the usual 10 marks) can be used to make up for lost marks in the labs and the second assignment.
O
2 )sunob 2+( 8 kraM
elyts fo noitaulave evitcejbuS ytilanoitcnuf fo gnitsetotuA tnenopmoC
.SMCbeW no deksa snoitseuq no desab selpmaxe/snoitacifiralc emos deddA rebotcO ht91
.QAF eht ot dna gniodnu no snoitacifiralc deddA selif nuryrd lla daolnwod ot knil a deddA .)sliated rof rof noitces eht ees( snoitulos ecrof-eturb dna lamitpo eht fo sezis eht yb denimreted ,dlohserht emos naht rellams si noitulos tide ruoy ni sdnammoc fo rebmun eht fi tset hcae ssap ll’uoy ,daetsnI .’noitulos ledom’ on won si erehT . rof tnemeriuqer ‘ssentcapmoC’ eht morf sseneugav devomer dna deifiralC
).tnemngissa siht rof yrassecennu si hcihw ,galf noitasimitpo na tsuj si
( .gniggubed stroppus hcihw , htiw ti decalper dna enil noitalipmoc eht morf galf eht devomeR
tsil ytpme na gninruter tuoba QAF eht ot rof noitacifiralc a deddA .ti eerf nac resu eht taht taht hcus detacolla eb syawla dluohs gnirts denruter eht – QAF eht ot rof noitacifiralc a deddA
evah syawla lliw ti ,gnirts ytpme eht si
. gnieb txet tupni eht no
“.dne eht ta enilwen a eht fo eno ot rewsna eht dexiF rednu QAF eht ot noitseuq a deddA
QAF eht morf
tuoba noitseuq gnisufnoc devomeR rebotcO ht11
!yrroS .maxe mretdim eht ton – tnemngissa dnoces eht dna sbal eht ni skram tsol rof pu ekam ylno won nac skram sunoB noitces “noissimbuS etaL” ot sliated deddA
detset eb lliw
QAF eht ot rof elpmaxe na deddA woh no QAF eht ot sliated deddA
sselnU” :snoitseuq
elbaliava won era snoitcurtsni noissimbuS rebotcO ht31
skraM
rebotcO ht51
rebotcO ht41
rebotcO ht9
rebotcO ht8

We will run a number of tests against your textbuffer implementation. These will be much more comprehensive than the tests we run during submission. You get marks for each test you pass.
We will also test your program for memory leaks (memory you have allocated and have responsibility to free but never free’d) and memory errors. Your program will be tested for memory leaks/errors via valgrind.
Style marks will include comments, indentation, variable names, etc., and will also include marks for choosing an appropriate representation for your ADT and for the efficiency of the functions you implement. For example, you will lose marks if your implementation of a function has a time complexity of O(n^2) when there is a solution with a time complexity of O(n) or O(n * log n).
You need to submit one file: textbuffer.c
You can submit from the assignment page on WebCMS via the give interface or by running the
command below:
The submission system runs a few simple dryrun tests. All files used by the dryrun are available here (click here to download the whole lot). After the deadline, all functions will be more thoroughly tested by the automarking system.
You can submit multiple times – only your last submission will count.
A late penalty of 15% per day will be applied. The latest you can submit the assignment is 9am, 31 October 2019, of course with late penalty.
give cs2521 assign1 textbuffer.c
textbuffer.h
textbuffer.c
testTextbuffer.c
Note: When we test your assignment, it with be compiled with gcc and the following flags:
noissimbuS etaL
.9102 rebotcO 62 yadrutaS ,ma9 :enildaeD
noissimbuS
seliF
skraM 2 – elytS
skraM )2+( 8 – gnikramotuA
/
/
/

textbuffer.h
We represent the ADT by way of a handle of type TB. The handle type is declared in the header file, but you will have to provide an implementation of the handle representation – i.e. of struct textbuffer – as part of your implementation:
typedef struct textbuffer *TB;
Refer to the lecture about ADTs for examples of this construction.
A textbuffer is an ordered collection of strings, where each string represents one line of a text file. Your implementation must keep the lines of a textbuffer in a linked data structure (such as a linked list or a variant of that). Each line must be represented as a (dynamically allocated) string. Adding, deleting, or moving lines requires manipulation of the linked structure. Such a data structure may, for example, be used as part of a text editor.
TB newTB (char *text);
newTB allocates a new textbuffer and initialises its contents with the text in the given string. Each fragment of the string that ends with a newline character (‘
’) indicates a separate line in the textbuffer.
gcc -Wall -Werror -std=c11 -g -lm -o testTextbuffer testTextbuffer.c textbuffer.c
eht yfidom TON tsum uoY !skram on ro wef gnitteg ksir uoy ,esiwrehtO .ylesicerp noitacificeps siht wollof tsum uoy ,margorp gnikram detamotua na yb dedrawa era skram sA
.elif
.ecafretni
eht fo stnenopmoc eht fo noitpircsed a si gniwollof ehT
noitacificepS TDA
BTwen rotcurtsed dna rotcurtsnoC
noitatnemelpmi eht fo seitreporp deriuqeR
BTesaeler
epyt TDA ehT

void releaseTB (TB tb);
releaseTB frees the memory occupied by the given textbuffer. It is an error to access a textbuffer after
freeing it.
char *dumpTB (TB tb, bool showLineNumbers);
dumpTB allocates and returns a string containing the text in the given textbuffer. The returned string should contain newline characters (‘
’) to indicate the end of each line in the textbuffer. It is the caller’s responsibility to free the memory occupied by the returned string. If there are no lines in the textbuffer, return an empty string (the string should still be allocated). If showLineNumbers is true, prepend a line number (along with a dot and space) to each line of the output.
For example, if dumpTB was called on a textbuffer containing the lines “hello world” and “amazing”, and showLineNumbers was true, it should return “1. hello world
2. amazing
”. If showLineNumbers was false, it should instead return “hello world
amazing
”.
int linesTB (TB tb);
linesTB returns the number of lines in the given textbuffer.
abort()
void addPrefixTB (TB tb, int from, int to, char *prefix);
addPrefixTB adds the supplied prefix to all lines between from and to (inclusive). If to is less than
from, abort.
For example, consider calling addPrefixTB (tb, 1, 3, “goodnight “):
. noitcnuf dradnats eht htiw margorp eht etanimret dna egassem rorre elbatius a tnirp tsum noitcnuf eht ,)reffubtxet eht ni senil fo rebmun eht naht reggib ro 1 naht rellams ,.e.i( egnar fo tuo si rebmun enil a gnitacidni stnemugra eht fo yna fi ,snoitcnuf gnitide lla roF
.1 xedni/noitisop ta si reffubtxet a fo enil tsrif ehT
.tnemugra reffubtxet rieht retla ton od snoitcnuf gniwollof ehT
BTxiferPdda
gnitide reffubtxeT
snoitcnuf yreuQ
BTsenil
BTpmud

void deleteTB (TB tb, int from, int to);
deleteTB deletes the lines between from and to (inclusive) from the textbuffer tb. It should free the
memory of the deleted lines. If to is less than from, abort.
Note that for these functions, if the number of lines in tb1 is n, then n + 1 is a valid argument for pos (the lines in tb2 are added to the end of tb1).
void mergeTB (TB tb1, int pos, TB tb2);
mergeTB merges tb2 into tb1 at line pos. Afterwards, what was at line 1 of tb2 will now be at line pos of tb1. Line pos of tb1 will be moved to line pos + linesTB (tb2), after the merged-in lines from tb2. After this operation, tb2 cannot be used anymore (as if we had used releaseTB on it).
void pasteTB (TB tb1, int pos, TB tb2);
pasteTB copies (i.e., pastes) all lines from tb2 into tb1 at line pos. It is like mergeTB, but tb2 remains
unmodified and is still usable independent of tb1.
The textbuffers returned by the extracting functions are as if they were newly created with newTB().
abort()
abort()
TB cutTB (TB tb, int from, int to);
+ —————————- ++ ———————————— +
| room
| moon
| cow jumping over the moon
| light
+ —————————- +
|| goodnight room |
|—>| goodnight moon |
| |
| goodnight cow jumping over the moon|
| light|
+ ———————————— +
. noitcnuf dradnats eht htiw margorp eht etanimret dna egassem rorre elbatius a tnirp tsum noitcnuf eht ,egnar fo tuo si rebmun enil a gnitacidni stnemugra eht fo yna fi ,snoitcnuf gnitcartxe lla roF
. noitcnuf dradnats eht htiw margorp eht etanimret dna egassem rorre elbatius a tnirp tsum noitcnuf eht ,egnar fo tuo si rebmun enil a gnitacidni stnemugra eht fo yna fi ,snoitcnuf gninibmoc lla roF
sreffubtxet gnitcartxE
sreffubtxet gninibmoC
BTtuc
BTetsap
BTegrem
BTeteled

cutTB cuts the lines between from and to (inclusive) out of the textbuffer tb into a new textbuffer, which is then returned. If to is less than from, return NULL.
Match searchTB (TB tb, char *search);
searchTB returns a linked list of all non-overlapping matches in tb of a certain string. The search is case sensitive and the textbuffer tb must remain unmodified. The matches must be returned in order of their appearance in the textbuffer. It is the caller’s responsibility to free the returned list.
Consider calling searchTB (tb, “love”) on the following TB:
This should return a list:
1 Hello World My
2 name is jarred lovegood
3 and i love carley ray jepson
+====================++====================+
| lineNumber: 2|| lineNumber: 3|
| columnNumber: 16 || columnNumber: 7|
| next: —————–>| next: —————–> NULL
+====================++====================+
Match NULL
void formRichText (TB tb);
formRichText searches every line of tb and performs the following substitutions:
*some string*
some string
*hello* -> hello
_some string_
some string
_hello_ -> hello
#some string …

some string …

#hello ->

hello

elpmaxE tnemecalpeR gnirtS
. nruter neht ,sehctam on era ereht fI .tsil eht ni edon tsrif eht ot retniop a si taht etoN
.hctam a si ereht erehw enil eht nihtiw noitisop a ot srefer rebmun nmuloc ehT .)1 ta trats ,.e.i( dexedni-1 htob era rebmun nmuloc dna rebmun enil eht taht etoN
sreffubtxet gnihcraeS
txeThciRmrof txet hciR

The matching is simplistic in that you would begin scanning at the first special character and continue to consume characters (ignoring any further special characters) until a matching special character. If there is no matching special character, nothing is done and the next special character (if there is one) is processed.
Note that the # character must be the first character in a line and there must be more characters on that line for it to be treated as a special character – otherwise, it does nothing. Furthermore, it matches until the end of the line and not until a matching #. See example below.
*some string
*some string
*some string*lol*
some stringlol*
**

*some_string*again_
some_stringagain_
*some* _string_
some string
some *string_again_
some *string again
some#string*once_again*
some#string once_again
#string_stuff_

string_stuff_

#
#
###
In the case of nested special characters, for example:
Take the outermost element and ignore any nesting.

##

*some_string_*
#some _string_
*some_string_*
some_string_
tluseR elpmaxE
tluseR elpmaxE

#some _string_

some _string_

If there are no characters between a pair of consecutive special characters, for example, hello ** world, ignore it and continue to the next pair of special characters (if there is one). For example:
Note that in the last case, the first * does nothing because there are no characters between it and the next *. In that case the first * is ignored and the next one is processed as normal.
char *diffTB (TB tb1, TB tb2);
Given two text files, we sometimes want to know what changes are made from one file to another file.
The function diffTB works out which lines of texts are added or deleted from tb1 to get tb2. The string returned from the function is an edit solution consisting of a series of add and delete commands. Applying such commands on tb1 in sequence should result in tb2.
An edit solution should have one command per line to either add or delete a line of text at a specific line number. An example is given below. The first command adds a line of text ‘add this line please’ at line 2 of the current textbuffer (counting from 1). The existing line 2 is moved to line 3, and so on. The second command deletes line 3 of the textbuffer. The last command adds the specified text at line 12 of the textbuffer.
A mark is given if your solution satisfies two criteria given below:
Correctness – applying your edit solution on tb1 results in tb2.
Compactness – the size of your edit solution (i.e., number of commands/lines) is smaller than or equal to the average of the sizes of the optimal solution and the brute-force solution (which is “delete all lines of tb1 and add all lines of tb2”). This is to avoid brute-force solutions, such as the one just described.
hello ** world
hello **world*
hello **world**
**hello***world** –> * hello* world*
***hello* –> ** hello
–> hello ** world
–> hello * world
–> hello * world*
+,2,add this line please
-,3
+,12,add this line as well please
)kram sunob 1( BToder dna BTodnu
)kram sunob 1( BTffid segnellahC sunoB 1 tnemngissA
tluseR elpmaxE

void undoTB (TB tb);
undoTB allows the user to reverse up to 10 of the most-recently called operations on tb. Applicable operations are: deleteTB, mergeTB, pasteTB, and cutTB. Each time undoTB is called, one operation is reversed on tb. When the maximum number of allowable undo operations is reached, further calls to undoTB should do nothing (until one of the applicable operations is performed again or redoTB is called).
void redoTB (TB tb);
The function redoTB allows the user to redo operations that have been reversed by undoTB. Similar to undoTB, this function should redo one operation on tb per function call. However, when a new operation is called on tb, any reversed operations cannot be executed again with redoTB.
undoTB redoTB addPrefixTB formRichText
Yes. No.
textbuffer.h
No.
newTB
math.h
textbuffer.c
Yes! Make sure your helper functions are declared static, and that you document what the functions and structures you add are for.

Yes. It’s much, much harder if you don’t.
valgrind
We’ll certainly be checking your submission with valgrind for memory leaks.
TB NULL
It can be in the case something goes wrong but in any case you have a TB which is NULL the correct course of action would be to print a suitable error message and abort().
?skram sunob eht tceffa snoitcnuf sunob fo ytixelpmoc emit eht lliW ?yrarbil eht esu I naC
?
ot snoitcnuf dna stcurts nwo ym dda I naC
QAF 1 tnemngissA 1252PMOC
.snoitarepo hcus gniodnu tuoba yrrow ot evah ton od uoy os , dna
sa hcus snoitarepo elbacilppani llac ton lliw ew ,snoitcnuf dna ruoy gnitset nehW :etoN
?
? ebreve naC htiw edoc ym kcehc ot deen I lliW ? morf snoitcnuf esu I naC
?krow seod woH BTwen
? yfidom I naC snoitseuq lareneG

If the input text is, for example, “Hi there,
how
are
things
”, the textbuffer should contain the following lines: { “Hi there,”, “how”, “are”, “things” }. You will have to process the input text, extract all the substrings separated by newlines, and copy them into your textbuffer structure.


Depending on your approach to splitting text, they may already be gone. The only other place you need the ‘
’ characters is in dumpTB, so you could probably get away without storing them. But it is up to you.
Unless text is the empty string, it will always have a newline at the end.
Every newline marks a new line in the textbuffer, so a newline that immediately follows another newline (or a newline at the beginning of the input text) would represent an empty line. You need to track empty lines.
No. Your program should be able to dynamically allocate any memory needed for your strings depending on the input text.
Create an empty TB.
Create a TB with one empty line.
NULL
We won’t be testing this (as NULL is not a valid string), but in this case a sensible thing to do would be to print a suitable error message and abort().
releaseTB
You can’t. You can’t write a black-box test for a destructor.
When you free() memory, what you’re saying is that you no longer need the block of memory you had a pointer to; it should be irrelevant to you whether that memory’s value changes or becomes invalid in some way, because you are absolutely forbidden from accessing the memory once free’d. Use-after-free is an illegal and undefined operation.
A good test that your releaseTB worked is that your program is still running after you do so.
Do note though that valgrind may be useful to help diagnose memory leaks which can indirectly
signal a error with your releaseTB.
dumpTB
It should return an empty string, regardless of whether showLineNumbers is true or false. Note that this string should still be allocated so that the user can free it.
?nruter dluohs tahw ;senil on sah reffubtxet yM BTpmud
?
?retcarahc enilwen elgnis a tsuj fo stsisnoc txet tupni eht fi tahW
? tset I nac woH BTesaeler
si txet tupni eht fi tahW
?gnirts ytpme a si txet tupni eht fi tahW
?senil rof htgnel mumixam a emussa I naC
?senilwen evitucesnoc elpitlum htiw neppah dluohs tahW ?dne eht ta enilwen a evah syawla lliw txet tupni eht taht emussa ot efas ti sI
?ni sretcarahc eht evael I dluohS

No. We will not test these cases. Yes. In this case, do nothing.
NULL
No. In this case, abort().
mergeTB (tb1, 1, tb1)
Attempts to merge a textbuffer with itself should be ignored.
releaseTB
No! This will probably destroy both the source and destination textbuffers. However, you’ve moved the contents of the source textbuffer, so you can just free() as you would in releaseTB. You must not subsequently dereference it; that’s a use-after-free and (say it with me, folks!) use-after-free is illegal.
mergeTB
The correct behaviour should be as follows, for mergeTB (dest, pos, src): pos == 1: Insert src before the start of dest.
pos == linesTB (dest): Insert src before the last line of dest.
pos == linesTB (dest) + 1: Append src to the end of dest.
tb1 tb2
Both may be empty. If dest is empty then the only valid value for pos is 1, which would cause src to be appended to the end of the empty TB.
Yes! For example, suppose tb was:
Then after calling pasteTB (tb, 2, tb), tb would look like:
1 Never gonna give you up
2 Never gonna let you down
1 Never gonna give you up
2 Never gonna give you up
3 Never gonna let you down
4 Never gonna let you down
?
I fi neppah dluohs tahW BTegrem
?flesti otno detsap eb reffubtxet a naC BTetsap
?ytpme era ro fi neppah dluohs tahW
?
htiw sreffub txet etanetacnoc I naC
?llew sa llac I dluohS
? eb gnirts xiferp eht naC ?gnirts ytpme eht eb gnirts xiferp eht naC ?ti ni senilwen evah gnirts xiferp eht naC
BTxiferPdda

No. We will not test these cases.
Yes. In this case, return an empty list.
In general, this depends on the representation of the list. If the list is represented by a structure containing metadata about the list (such as its size, the pointer to the first node, etc.), like in the Week 1 and Week 2 labs, then an empty list is represented by a (pointer to a) metadata structure where the size field is set to 0, and the pointers to the first/last nodes are set to NULL. If the list is represented by a pointer to the first node, then an empty list is represented by a NULL pointer, as there are no nodes in the list. In this assignment, because a list of matches is merely represented by a pointer to the first match node, an empty list is represented by NULL.
No. In this case, abort().
Yes. In this case, the returned list of matches should have a node for each of the occurrences on that
line. For example, if searchTB (tb, “bird”) is called, and tb is:
The returned list should be:
The matches you return should not overlap. After you find a match on a line, the search should resume from after the part of the line that was matched. For example, if we searched for “abracadabra” in the string “abracadabracadabracadabracadabra”, the matches are “abracadabracadabracadabracadabra”. So if we searched for “abracadabra” in this textbuffer:
The returned list should be:
1 A well a everybody’s heard about the bird
2 B-b-b bird, bird, bird, b-bird’s the word
3 A well a bird, bird, bird, the bird is the word
4 A well a bird, bird, bird, well the bird is the word
5 A well a bird, bird, bird, b-bird’s the word
(1, 38) –> (2, 7) –> (2, 13) –> (2, 19) –> (2, 27) –> (3, 10) –> (3, 16) –> …
1 abracadabra alacazam
2 abracadabracadabracadabracadabra
(1, 1) –> (2, 1) –> (2, 15) –> X
?)’bababa’ ni ‘baba’ rof gnikool ,.g.e( nrettap detaeper a si gnirts hcraes eht erehw esac eht eldnah uoy od woH
?enil emas eht no semit elpitlum rucco gnirts hcraes eht naC ?LLUN eht eb gnirts hcraes eht naC
?tsil ytpme na nruter I dluohs woH ?gnirts ytpme eht eb gnirts hcraes eht naC ?ti ni senilwen evah gnirts hcraes eht naC
BThcraes

**
In this case, nothing should happen. Only add the tags if there is at least 1 character being acted on. No.
diffTB
No. diffTB is non-destructive.
diffTB
There are many possible valid sequences of commands that could be returned from diffTB, so comparing the output against an expected output would not work. Instead, we will parse your edit solution and apply the commands one by one to tb1. After applying the commands, we will call dumpTB on tb1 and tb2. If they return the same string, and your edit solution consists of fewer commands than the threshold, then you pass the test.
Certainly!
Suppose that these are tb1 (left) and tb2 (right):
Here are some examples of correct command strings (there are others):
1 first line
2 second line
3 third line
4 fourth line
1 first line
2 2nd line
3 third line
4 quatre
“+,2,2nd line
-,3
+,4,quatre
-,5

“-,2
+,2,2nd line
-,4
+,4,quatre

“-,2
-,3
+,2,2nd line
+,4,quatre

“-,4
-,2
+,3,quatre
+,2,2nd line

undoTB redoTB mergeTB
Your implementation of the applicable functions will probably be split into two parts: (1) one part that allows undoTB and redoTB to work, and (2) a second part that actually does the main work of the function. In checking your functions’ time complexities we will only consider the second part of the code.
?snoitcnuf eseht rof ytixelpmoc emit wols a gnivah rof desilanep eb I lliW .seitixelpmoc emit rieht stceffa hcihw ,) ,.g.e( snoitcnuf gnitsixe yfidom ot em seriuqer dna fo noitatnemelpmi yM
BToder dna BTodnu
?stnemugra reffubtxet sti fo rehtie egnahc seoD BTffid
?) sa hcus( sretcarahc laiceps fo riap a neewteb sretcarahc on era ereht erehw sesac eldnah I dluohs woH
?elpmaxe na teg ew dluoC
?detset eb lliw woH
?senil ssorca rucco snoitutitsbus naC
txeThciRmrof

It’s up to you – we won’t be testing these cases.
tb2
If you called mergeTB (dest, pos, src), src no longer exists, so calling undoTB (src) is invalid. Calling undoTB (dest) should simply remove the merged lines from dest (of course, they may reappear again if redoTB (dest) is called).
If you called cutTB (tb1, from, to), the returned TB (let’s call it tb2) is completely independent of tb1. Calling undoTB (tb1) should restore the lines that were cut from tb1, but have no effect on tb2.
If you called pasteTB (tb1, pos, tb2), the paste operation is performed on tb1, not tb2, so tb2 has no record of the operation taking place. Thus, calling undoTB (tb1) should remove the pasted lines from tb1 (they may reappear if redoTB (tb1) is called), while calling undoTB (tb2) should do nothing unless some operation was performed on tb2 before the paste.
This is an individual assignment. Each student will have to develop their own solution without help from other people. In particular, it is not permitted to exchange code or pseudocode. You are not allowed to use code developed by persons other than yourself. If you have questions about the assignment, ask your tutor.
Plagiarism is defined as using the words or ideas of others and presenting them as your own. UNSW and CSE treat plagiarism as academic misconduct, which means that it carries penalties as severe as being excluded from further study at UNSW. There are several on-line sources to help you understand what plagiarism is and how it is dealt with at UNSW:
Make sure that you read and understand these. Ignorance is not accepted as an excuse for plagiarism. In particular, you are also responsible that your assignment files are not accessible by anyone but you by setting the correct permissions in your CSE directory and code repository, if using. Note also that plagiarism includes paying or asking another person to do a piece of work for you and then submitting it as your own work.
UNSW has an ongoing commitment to fostering a culture of learning informed by academic integrity. All UNSW staff and students have a responsibility to adhere to this principle of academic integrity. Plagiarism undermines academic integrity and is not tolerated at UNSW. Plagiarism at UNSW is defined as using the words or ideas of others and passing them off as your own.
If you haven’t done so yet, please take the time to read the full text of
The pages below describe the policies and procedures in more detail:
msiraigalp dna ytsenoh cimedaca gnidrager ycilop s’WSNU
?niaga evila
?reffubtxet ytpme na gnigrem sa hcus ,BT eht no tceffe on sah taht noitarepo na drocer I dluohS
yciloP edoC tnedutS
erudecorP msiraigalP WSNU ytirgetnI cimedacA dna msiraigalP
?etsap a odnu I fi neppah dluohs tahW
?tuc a odnu I fi neppah dluohs tahW
sI ?egrem a odnu I fi neppah dluohs tahW
msiraigalP

You should also read the following page which describes your rights and responsibilities in the CSE context:
stnedutS ESC rof ecivdA laitnessE
erudecorP msiraigalP tnemetatS yciloP msiraigalP erudecorP tcudnocsiM tnedutS

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 C data structure math Your task is to implement an abstract textbuffer data type that meets the given interface.
30 $