notes div (abfunctiondivide by preconditionb ! postconditionoutput / there are two ways of implementing data structure viz static and dynamic in static implementationthe memory is allocated at the compile time if there are more elements than the specified memory then the program crashes in dynamic implementationthe memory is allocated as and when required during run time any type of data structure will have certain basic operations to be performed on its data like insertdeletemodifysortsearch etc depending on the requirement these are the entities that decide the representation of data and distinguish data structures from each other let us see why user defined data structures are essential consider problem where we need to create list of elements any new element added to the list must be added at the end of the list and whenever an element is retrievedit should be the last element of the list one can compare this to pile of plates kept on table whenever one needs platethe last one on the pile is taken and if plate is to be added on the pileit will be kept on the top the description wants us to implement stack let us try to solve this problem using arrays we will have to keep track of the index of the last element entered in the list initiallyit will be set to - whenever we insert an element into the list we will increment the index and insert the value into the new index position to remove an elementthe value of current index will be the output and the index will be decremented by one in the above representationwe have satisfied the insertion and deletion conditions using arrays we could handle our data properlybut arrays do allow access to other values in addition to the top most one we can insert an element at the end of the list but there is no way to ensure that insertion will be done only at the end this is because array as data structure allows access to any of its values at this point we can think of another representationa list of elements where one can add at the endremove from the end and elements other than the top one are not accessible as already discussed this data structure is called as stack the insertion operation is known as push and removal as pop you can try to write an adt for stacks another situation where we would like to create data structure is while working with complex numbers the operations addsubtract division and multiplication will have to be created as per the rules of complex numbers the adt for complex numbers is given below only addition and multiplication operations are considered hereyou can try to write the remaining operations the adt for complex numbers is as followsvalue definition definition clausethis data type has values +ib where and are integers and is equal to under root of - condition clausei term should be present operations addfunctionaddadd two complex numbers ib and ib preconditionno precondition post condition( ( lovely professional university