Learning outcomes
– Describe the purpose of Data Structures and Algorithms
– Identify their representation and usage in Java
– Apply basic serialisation techniques
What can you expect from the module?
– More Problem solving: Software Analysis and Design
– More Programming and the development toolset
– Selecting efficient solutions to software problems
– Analysing performance of operating software
1.Explain a range of fundamental data structures and their operations
This structure will be the best case because when searching for a number such as 7 we are going through three steps as shown in the diagram.
The worst case
In the worst case there will be six move as we search for the lowest number as shown in the diagram below.
The hash table has an average case of 0(1) in the case whereby one doesn’t know the size of the input items due to constant retrieve time. But if the items are continuously added it is better to use binary search tree’s 0(log (N)).
The binary search tree created in (a) above is a complete tree since all the nodes have children except nodes at the lowest level.
Question 2
First in First out data structure occurs when the first element in a queue is the first one to be removed while in Last in First out principle the last item in the stack is the first one to be removed.
Import java.util.Linkedlist;
Public class printNames{
Public static void main(String[] args){
/*Creation of a linked list*/
LinkedList list = new LinkedList();
/*adding values*/
List.add(“Mary”);
List.add(“John”);
List.add(“Kelvin”);
/*Printing the list*/
System.out.println(“LinkedList: ” + list);
/*Printing the size*/
System.out.println(“List size: ” + list.size());
Question 3
put(k,v) operations is used in Maps to insert a pair of element into the map in a form of <key, value> while get(k) is used to return a value of the key that has been specified.
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Fruits {
public static void main(String[] args) {
Map<String,String> hMap = new HashMap<String, String>();
List<Map<String , String>> Map = new ArrayList<Map<String,String>>();
hMap.put("Yellow", "Banana");
hMap.put("Green", "Apple");
hMap.put("Orange", "Orange");
Map.add(0,Map1);
Map.add(1,Map1);
for (Map<String, String> map : Map) {
System.out.println(map.get("Yellow"));
System.out.println(map.get("Green"));
System.out.println(map.get("Orange"));
In the code above, the line hMap.put ("Yellow", "Banana"); has been used to input a key which is a string value, that is, the color of the fruit followed by string banana. The key is then used by the get () method to retrieve the value of that string and display it using a for loop.
The use of put(k,v) and get(k) operations has some drawbacks in that when there are more than one entry that has the same key then the two values will be displayed at the same time. This results to a collision.
Compression functions are used to combine fixed lengths input to arrive to a single fixed length output therefore shortening the amount of data to be kept in a hash table. The main objective of a compression is that it reduces the number of collision that may occur in a given set of hash codes.
Question 4
package testhashes;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
public class searchsort {
public static void main(String[] args) {
Map<String, String> address = new HashMap<>();
address.put("vinny", "102");
address.put("peter", "123");
address.put("john", "576");
address.put("clark", "475");
addresssearch(address);
private static void addresssearch(Map<String, String> mapaddress) {
System.out.println("Orignal HashMap:" + mapaddress);
System.out.println("n1. Sort address by ascending keys: " );
TreeMap<String,String>mapSorted = new TreeMap<>(mapaddress);
mapSorted.forEach((key, value) -> {
System.out.println(key + "'s address is: " + value);
This data structure has a time complexity of O(1) on average case and best case while its worst case is O(n). This makes it more efficient than other data structures.
From the problem above we can rewrite it in a post-fix for to become:
Here how the stack data structure solves the problem:
The first digit starts
Maurer, W.D. and Lewis, T.G., 1975. Hash table methods. ACM Computing Surveys (CSUR), 7(1), pp.5-19.
Rogaway, P. and Shrimpton, T., 2004, February. Cryptographic hash-function basics: Definitions, implications, and separations for preimage resistance, second-preimage resistance, and collision resistance. In International workshop on fast software encryption (pp. 371-388). Springer, Berlin, Heidelberg
To export a reference to this article please select a referencing stye below:
My Assignment Help. (2020). Data Structures And Algorithms. Retrieved from https://myassignmenthelp.com/free-samples/5117comp-data-structures-and-algorithms/data-structures-in-a-given-problem-domain.html.
"Data Structures And Algorithms." My Assignment Help, 2020, https://myassignmenthelp.com/free-samples/5117comp-data-structures-and-algorithms/data-structures-in-a-given-problem-domain.html.
My Assignment Help (2020) Data Structures And Algorithms [Online]. Available from: https://myassignmenthelp.com/free-samples/5117comp-data-structures-and-algorithms/data-structures-in-a-given-problem-domain.html
[Accessed 27 January 2021].
My Assignment Help. 'Data Structures And Algorithms' (My Assignment Help, 2020) <https://myassignmenthelp.com/free-samples/5117comp-data-structures-and-algorithms/data-structures-in-a-given-problem-domain.html> accessed 27 January 2021.
My Assignment Help. Data Structures And Algorithms [Internet]. My Assignment Help. 2020 [cited 27 January 2021]. Available from: https://myassignmenthelp.com/free-samples/5117comp-data-structures-and-algorithms/data-structures-in-a-given-problem-domain.html.
When you hear the term "Mathematics", does it raise an alarm in your mind? Don't be so worried as the experts at MyAssignmenthelp.com are here to provide you with exclusive math homework help. Our Math solvers will help you get the right answers for calculus, trigonometry, etc. that had been messing with your head. If you are faced with time crunch and wondering, “Who will do my math homework at the earliest,” you have our assurance. The math question solvers offer affordable service along with the revision to make sure that the assignment is flawless.
Answer: In the modern stressful environment, different mood disorders are common leading to a major issue in behavioral patterns of individuals. Depression is a disorder which is tough to diagnose as it has no physical symptoms apart from a few behavioral changes (Segal, Williams and Teasdale 2018). Therefore it is normally assumed that a person suffers from depression if they lose interest in their daily life and routine for two weeks having ...
Read MoreAnswer: Culture can be described as the lifeblood of a vibrant society which can be expressed in different ways by which individuals tell their stories, remember their past as well as entertain themselves and imagine the future (Raman et al., 2017). The creative expression of the individuals help in defining what they are, how they should see the world through the eyes of the others. Along with the intrinsic values, culture is also seen to pr...
Read MoreAnswer: The above statement states that Money and Financial rewards are an important part that focuses on maintaining the relations of the employees. It is one of the major factors that help to motivate the employees in the workplace. It can be evaluated that the main focus of the employees is on money or the salary which is offered by the company. In motivating the employees, money is one of the factors that also give impact on the overall pr...
Read MoreAnswer: Introduction: Unlike the multinational, global and international strategies, the transnational strategy enables the firms to achieve local flexibility with rapid absorbing and differing innovation of parent company. The transnational strategy implies seeks global integration with operational efficiency and performance on a continued basis (Ambler, 2015). The choice is about global strategies where business firms can locate the d...
Read MoreAnswer: Introduction Financial Reporting is regarded as one of the major part in the financial operations of the companies and it is needed for the business organizations to follow all the required regulations and principles at the time of the development and presentation of the financial statements. The Conceptual Framework for financial reporting is an essential aspect for the business entities as it provides the companies with all the requ...
Read MoreJust share requirement and get customized Solution.
Orders
Overall Rating
Experts
Our writers make sure that all orders are submitted, prior to the deadline.
Using reliable plagiarism detection software, Turnitin.com.We only provide customized 100 percent original papers.
Feel free to contact our assignment writing services any time via phone, email or live chat. If you are unable to calculate word count online, ask our customer executives.
Our writers can provide you professional writing assistance on any subject at any level.
Our best price guarantee ensures that the features we offer cannot be matched by any of the competitors.
Get all your documents checked for plagiarism or duplicacy with us.
Get different kinds of essays typed in minutes with clicks.
Calculate your semester grades and cumulative GPa with our GPA Calculator.
Balance any chemical equation in minutes just by entering the formula.
Calculate the number of words and number of pages of all your academic documents.
Our Mission Client Satisfaction
Thanks for doing it on time...great work...fingers crossed for the grades...i hope i get good grades...its a great website to do assignments and all the exams
Australia
Satisfied with the writing style. The writer responded immediately for the revisions which were requested.
Australia
did not have time to start on my assignment and randomly googled for people to do it for me. To my surprise, i found myassignmenthelp and they did it for me just on time for my submission with even time to spare. My first time, but definitely not my ...
Australia
Thank you, thank you, thank you very much. It is one of the most beautiful and highest levels of the solution that I have seen in my life. In all honesty, the expert is very distinguished and he was at the heart of the solution to answer all the poin...
Australia