Question: obat Reader DC Al (1).pdf x Write a first module that creates the Sequence ADT. It should consist of Python code in a file named

 obat Reader DC Al (1).pdf x Write a first module that

obat Reader DC Al (1).pdf x Write a first module that creates the Sequence ADT. It should consist of Python code in a file named SeqADT.py. The module should define a class SeqT, which contains the llowing class methods that define the external interface: . A constructor (SeqTO) that takes no arguments and creates an object whose state consists of an empty sequence. . A method named add (i, v) that takes the following inputs: i and v, where i (an integer) is the index where the al(a real) should be added to the sequence. Values can only be added within the existing sequence, or immediately after the last entry in the existing sequence . A method named rm(i) that takes one argument: i (an integer). A call to this method modifies the sequence so that the entry at index i is removed. The length of the list will decrease by 1 . A method named set (i, v) that takes two inputs: i (an integer) and v (a real) set is used to modify the entry in the sequence at index i to have the value v . A method named get (1) that takes on input: i (an integer). This method returns the value of the sequence at index i (length) of the sequence (an integer) sequence object s, indexInSeq returns the index i such that s.get(i) s . A method named size) that takes no arguments and returns the current size . A method named indexInSeq(v) that takes a real number v as input. For the s.get(i+1) As in Python, the code should use O-based indexing. That is, the first entry in the sequence is at index 0. For a list of length n, the last entry is at index n -1 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!