Weekly excercises in Data Structures from the 2022 Spring Semester
- a2f1.c: Creates three sets (Integer, Characters, Letters) by setting the corresponding ASCII values as TRUE and then asks for input till it finds a valid integer. Does the same for a valid character.
- a6f1.c: Creates two sets (Alphabet, Vowels). Reads input (a String) three times. The number of vowels in the sentence is consistently counted and shown.
- a7f2.c: Returns the Nth element of a Stack in two different ways. (1) By popping out elements till it reaches the Nth one, returning it and then pushing all the values back using a temporary Stack or by (2) Using pointers on the Stack (StackLength-n+1)
- a18f2.c: Five values are entered in the Stack. Each time a value is entered, the minimum value is evaluated and is printed before and after every element added. The Stack empties, value by value, and the minimum value is printed correctly and correspondingly to the available values.
- a1f3.c: Twenty elements are added in the Queue. The program proceeds to calculate its size using two different ways: (1) With pointers and (2) By counting every value it removes. Twenty elements are added again in the Queue. Ten are removed. The size is calculated again with two different methods. In the last question, the two methods are used in a now-empty Queue.
- a13f3.c: A Queue is filled with the numbers 0, 0.5, 1, 1.5 ... 9.5, 10 and then reversed. The method used here is based on removing the elements from the Queue, adding them to a temporary Stack and then re-adding the elements back in the original Queue.