Array list, linked list, Stack, Queue, Binary tree, Hash table
At least one application example combining data structure and algorithm should be given.
1.Array list :-
ArrayList is a part of collection framework and is present in java.util package. It provides us with dynamic arrays in Java. Though, it may be slower than standard arrays but can be helpful in programs where lots of manipulation in the array is needed. This class is found in java.util package.
Advantages:
Applications -
Arraylist class implements List interface and
it is based on an Array data structure. It is widely used because
of the functionality and flexibility it offers. Most of the
developers choose Arraylist over Array as it’s a
very good alternative of traditional java arrays. ArrayList is a
resizable-array implementation of the List
interface.
It implements all optional list operations, and permits all
elements, including null
.
2.linked list:-
A linked list is a linear data structure, in which the elements
are not stored at contiguous memory locations. The elements in a
linked list are linked using pointers.
In simple words, a linked list consists of nodes where each node contains a data field and a reference(link) to the next node in the list.
Advantages
Disadvantages
Application -
Linked List allocation solves all problems of contiguous allocation. In linked list allocation, each file is considered as the linked list of disk blocks. However, the disks blocks allocated to a particular file need not to be contiguous on the disk. Each disk block allocated to a file contains a pointer which points to the next disk block allocated to the same file.
3.Stack:-
Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).
Application-
There are many real-life examples of a stack. Consider an example of plates stacked over one another in the canteen. The plate which is at the top is the first one to be removed, i.e. the plate which has been placed at the bottommost position remains in the stack for the longest period of time. So, it can be simply seen to follow LIFO(Last In First Out)/FILO(First In Last Out) order.
4.Queue :-
A Queue is designed in such a way so that the elements added to it are placed at the end of Queue and removed from the beginning of Queue. The concept here is similar to the queue we see in our daily life, for example, when a new iPhone launches we stand in a queue outside the apple store, whoever is added to the queue has to stand at the end of it and persons are served on the basis of FIFO (First In First Out),
Applications:-
1) When a resource is shared among multiple
consumers. Examples include CPU scheduling, Disk Scheduling.
2) When data is transferred asynchronously (data
not necessarily received at same rate as sent) between two
processes. Examples include IO Buffers, pipes, file IO, etc.
5. Binary Tree :-
A tree whose elements have at most 2 children is called a binary tree. Since each element in a binary tree can have only 2 children, we typically name them the left and right child.
A Binary Tree node contains following parts.
Application-
One reason to use trees might be because you want to store information that naturally forms a hierarchy. For example, the file system on a computer.
Binary Search Tree is a tree that allows fast search, insert, delete on a sorted data. It also allows finding closest item
6.Hash table :-
Hashing is an important Data Structure which is designed to use a special function called the Hash function which is used to map a given value with a particular key for faster access of elements. The efficiency of mapping depends of the efficiency of the hash function used.
Applications-
Suppose we want to design a system for storing employee records keyed using phone numbers. And we want following queries to be performed efficiently:
Array list, linked list, Stack, Queue, Binary tree, Hash table At least one application example combining...
Array list, linked list, Stack, Queue, Binary tree, Hash table. In which cases do they apply to (combined with time complexity analysis) please answer the question completely note: which cases do they apply to (combined with time complexity analysis)
Array list, Linkedlist, Stack, Queue, binary tree, hash table What are their respective logical and physical / storage structures? i am asking this question note what are their respective logical and physical / storage structures?
Binary tree please answer these two question properly about binary tree Q(1) What are their respective logical and physical / storage structures .Q(2) At least one application example combining data structure and algorithm should be given.
Linked list: 1) What are their respective logical and physical / storage structures .2) At least one application example combining data structure and algorithm should be given. please answer these two questions properly
Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create a hash table that is an array of trees. To display a small tree-based hash table, you could use an inorder traversal of each tree. The advantage of a tree over a linked list is that it can be searched in O(logN) instead of O(N) time. This time savings can be a significant advantage if very high load factors...
The Task: Create a console application that prompts the user to select either a stack, queue, linked list, or binary search tree. Then prompt the user for a number that will then be passed to a recursive function that will populate an array in ascending order. If user selected binary search tree, they will then be prompted to choose how the data will be received either in-order, preorder, or post-order. If user selected linked list, they will then be prompted...
Create a flowchart to represent the Push and Pop operations for a Stack based on a linked list data structure. Create a flowchart to represent the Enqueue and Dequeue operations for a Queue based on a linked list data structure. Write the required Java code to implement either a Stack or a Queue data structure based on a linked list. The code should include the class constructors, the necessary properties, and methods to add and remove elements from the data...
Queue data structure: please answer these two question properly Q(1) What are their respective logical and physical / storage structures .Q(2) At least one application example combining data structure and algorithm should be given.
Insert elements into a hash table implemented using chain hashing, as an array of linked list in which each entry slot is as a linked list of key/value pairings that have the same hash (outcome value computed using certain hash function). You are allowed to use “Hash Function”, h(k) = k % x where, x is the value you will need to decide to use, that you find appropriate for this implementation. The main requirements are the following: 1. Input:...
for java 4. Instead of using a linked list to resolve collisions, as in separate chaining, use a binary search tree. That is, create a hash table that is an array of trees. To display a small tree-based hash table, you could use an inorder traversal of each tree. The advantage of a tree over a linked list is that it can be searched in O(logN) instead of O(N) time. This time savings can be a significant advantage if very...