Follow Me

ADTs exercises in C Programming in C

  • ADT for a point: Provide an ADT specification for a point in a two dimensional space. By definition, to create such a point, you need to provide two coordinates. Supplement your ADT with adequately chosen query functions....
  • ADT for a robot: We aim to define a \(\texttt{Robot}\) ADT moving in a two dimensional space with functions allowing to: Create a robot from a position \((x, y)\) and a direction (\(\texttt{North}\), \(\texttt{South}\), \(\texttt{East}\), \(\texttt{West}\)) that beco...
  • ADT for Boolean type: Provide an ADT specification for \(\texttt{Boolean}\) type. By definition, a Boolean is either \(\texttt{true}\) or \(\texttt{false}\). The negation (\(\texttt{Not}\)) of a Boolean is also a Boolean. The \(\texttt{and}\) and \(\texttt{or}\) between t...
  • ADT for a set of n elements: Write an ADT specification for a set of n elements. Operations include (create set, add an element to a set, delete an element from a set, check whether an element is in a set, union of 2 sets, intersection of 2 sets, cardinality of a set, complement...

Back to the list of exercises