Follow Me

Deque exercises in C Programming in C

  • Implementation of a deque: A deque is a data structure that allows both deletion as well as insertion of elements to be done at both ends of a queue. Consider the following code: \(\texttt{typedef $\cdots$ element ;}\\\texttt{struct cell \{ element data; struct cell *next; \}}\\\texttt{typedef struct \{ struct cell *front, *rear; \} deque;}\)...
  • A Mazing Problem: The rat-in-a-maze experiment is a classical one from experimental psychology. A rat (or mouse) is placed through the door of a large box without a top. Walls are set up so that movements in most directions are obstructed. The rat is carefully observe...
  • Implementation of a deque using a doubly-linked list: Implement a deque using a doubly-linked list....
  • Implementation of a deque using a circular list: Implement a deque using a circular list....
  • Static implementation of a deque: A deque is a data structure that allows both deletion as well as insertion of elements to be done at both ends of a queue.  Implement a deque using a circular array....
  • Maximum sum in sliding window: Given array \(\texttt{A[]}\) with sliding window of size \(\texttt{w}\) which is moving from the very left of the array to the very right. Assume that we can only see the \(\texttt{w}\) numbers in the window. Each time the sliding window moves rightw...
  • Implementation of a deque using a doubly circular linked list: Implement a deque using a doubly circular linked list....
  • ADT for a Deque: Complete the following abstract data type \(\texttt{Q2En}\) (Queue with 2 ends), which is a linked structure of elements supporting the insertion and removal of elements at the beginning and at the end, by including operators allowing to: create a \(\texttt{Q2En}\)...

Back to the list of exercises