You are on page 1of 3

In this week, we were working with the chapter of Lists, Stacks, and queues in A

Practical Introduction to Data Structures and Algorithm Analysis and two of the
recommended topics of different books. The chapters are based on the topics of
lists and the differences between array and linked list based implementations,
singly versus doubly linked lists, Stacks and push and pull operations, queues and
enqueue and dequeue operations, Circular queues and doubly linked list queues
and Dictionaries. Now, I discuss what I have done through this week.

Date: 1.12.19
In this particular day, I am working with the reading assignment. In the reading
assignment, I start with the topic of lists and difference between array and linked
list based implementation. We define the list as finite and there are some order of
sequences of data items, those are call as elements. A list is said to be empty
when there are no elements. The number of elements currently stored is called
the length of the list. The beginning of the list is called the head, the end of the
list is called the tail. There are different types of lists like sorted list, unsorted list
etc. Sorted list is in ascending order and unsorted list in descending order. I read
the descriptive part of the lists. Next, I come to the topic of array base list and
linked list implementation. The array-based list implementation, named AList.
AList inherits from abstract class List and so must implement all of the member
functions of List. There are one coding example of array which can clarify one’s
understanding. The linked list is the implementation of lists using pointer. The
linked list uses dynamic memory allocation, that is, it allocates memory for new
list elements as needed. A linked list is made up of a series of objects, called the
nodes of the list. The list’s first node is accessed from a pointer named head. To
speed access to the end of the list, and to allow the append method to be
performed in constant time, a pointer named tail is also kept to the last link of the
list. The position of the current element is indicated by another pointer, named
curr. I read the topic and understand the linked list quite easily. After that, I find
out the differences between singly and doubly linked lists. Every element of
singly-linked list contains some data and a link to the next element, which allows
to keep the structure. On the other hand, every node in a doubly-linked list also
contains a link to the previous node. In singly linked list the complexity of
insertion and deletion at a known position is O(n). In case of doubly linked list the
complexity of insertion and deletion at a known position is O(1). There are some
other differences which are quite understandable. Next, Stack is a list-like
structure in which elements may be inserted or removed from only one end. In
stack, the accessible element is called the top element. The push function is used
to insert data and the pop function is used to remove data from the stack. There
are two ways of stack implementation and they are array-based and linked list
based. I see two of the implementation and introduce with some of the examples.
The queue is a list-like structure that provides restricted access to its elements.
Queue elements may only be inserted at the back (called an enqueuer operation)
and removed from the front (called a dequeue operation). Queue is also
implemented same way as we see in the stack part. Circular Queue is a linear data
structure in which the operations are performed based on FIFO (First In First Out)
principle and the last position is connected back to the first position to make a
circle. It is also called ‘Ring Buffer’. In normal queue, you can’t enqueue on the
front because you dequeue data from front and enqueue from the back. For this
problem, we use circle queue which can easily fulfill the open front space. Next, I
am working with the dictionaries topic. This topic is also quite interesting. I read
out the addition recommended part. This is all about what I have learnt through
this week.

Date: 3.12.19
In this day, I am working with the discussion assignment and stack programming
assignment. In the discussion assignment, I am working with the stack and queue.
I mention the functionalities and the differences between them. I want to some of
the part here. Stack is a linear data structure in which data may be inserted and
removed from only one end. It follows the principle of LIFO(Last-In-First-Out).
LIFO means the data which enter at last will remove first. I can add an example of
lift. Queue is also a linear data structure in which data may be inserted and
removed from two ends. It follows the principle of FIFO(First-In-First-Out). LIFO
means the data which enter at first will remove first. Queue elements may only
be inserted at the back which is called enqueue and remove from the front which
is called dequeue. For example, in a queue where people line up to pay for their
groceries at their local convenience store, the first person in the queued line will
be served first and will be the first one out, it will work for others in the line. The
basic difference between stacks and queues is in removing. In a stack we remove
the item the most recently added; in a queue, we remove the item the least
recently added. In the programming assignment part, I develop an algorithm
using the Java programming language that implements a basic stack data
structure. The assignment has some requirements as like stack must have the
ability to push entries on the stack. My stack must also have the ability to pop
entries off of the stack. They also give an example of automobiles which can
visualize the solution of the problem. I develop my algorithm using Java code, and
by using the Jeliot tool as a development environment. I successfully develop the
code and run it on the jeliot tool. I also discuss the asymptotic analysis in a paper
of the algorithm which I develop. I am quite happy after doing the tasks. I
interacted with my peers group about the discussion forum and they gave me
positive feedback. I am satisfied what I have learnt. I have leant some good data
structure and algorithm knowledge. I did not surprise with anything in this unit. I
did not feel any challenging situation in this unit. I am recognizing myself that I am
gaining good skill over data structure and algorithm. I want to apply this
knowledge in my professional life.

You might also like