SHRI SHANKRACHARYA INSTITUTE OF TECHNOLOGY & MANAGEMENT,BHILAI
Presentation on
IMPLEMENTATION OF DATA STRUCTURE OPERATION FOR STACK, QUEUE, LINK LIST IN JAVA
From :SUMAN SAHU ANKIT AGRAWAL AJAY KUMAR PRASAD
ABSTRACT
A linked list is a particular type of data structure, made up of objects linked together by pointers. we used a linked list to store an ordered list of Strings, and we implemented insert, delete, and find operations on that list. However, we could easily have stored the list of Strings in an array or Array List, instead of in a linked list.
STACK
1) A STACK is a container of objects that are inserted and removed according to the last in first out principle. 2) Objects can be inserted at any time, but only the last object can be removed.
3) Inserting an item is known as pushing onto the stack. Popping off the stack is synonymous with removing an item.
QUEUE
1. A QUEUE differs from a stack in that its insertion and removal routines follow the first-in-first-out principle. 2. Elements may be inserted at any time, but only the element which has been in the queue the longest may be removed. 3. Elements are inserted at the rear and removed from the front.
LINKED LIST
1. A linked list is a collection of objects linked to one another like a string of pearls. 2. A queue is a first-in-first-out structure. Elements are added at one end and removed from the other end. 3. Queue behavior is subsumed by Ordered Collection and there is no need for class Queue.
METHODOLOGY
Implementing Stacks with Arrays :When the Array Stack object is first created, it starts with an array of size 10. Adding an element requires that there be room in the array. If not, you have to make the array bigger to hold the added element.
Implementation of stack ADT
A similar comparison shows that Node Lists pop has exactly the same four statements as Header Lists pop, plus two additional, so the coding for pop saves two assignments.
Queue Implementation Link List
Pointer-Based Implementation 1. Can be implemented using linear linked list. 2. Linear linked list. Need two external pointers
Array Implementation VS Linked Lists
Implementation Array Prevent the queue operation from adding in item to the queue if the array is full No Overhead of pointer manipulation Linked List No Size restricted on the queue operation More efficient, and flexible More complicated than ADT.
SOLUTION STATEMENT
1. Huge standard library. Lots of third-party libraries. 2. Well standardized and portable, no problems with non-standard compilers. 3. High performance, great support for multicore. 4. Simple language, much fever caveats and sharpedges than in C++. 5. Awesome tooling.
ADVANTAGES OF USING JAVA
Java is easy to learn. Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn and other programming languages. Java is Object Oriented. This allows you to create modular programs & reusable codes. Java is Platform independent.
CONCLUSION
Queue is Data Structure that implement FIFO Concept. Queue can be implemented using array or linked list. Queue linear array has right word drift problem and can be solved using circular array implementation.
THANK YOU