Skip to content
Advertisement

Tag: graph

Scanning input in HashMap of String and ArrayList

I need to add all these cities in a HashMap of String and ArrayList And I am unable to add these , I have the structure So now i need to add banglore and then if banglore is present i will add Hyderabad to the ArrayList and again I’ll scan for the next element again banglore is present so add

Experimental Analysis of an Algorithm – How to prove that the graph is O(nlogn)?

This question is probably stupid, but I’ve been trying to figure this out for hours and I still couldn’t find anything about it. Probably I’m just too lost. So basically, I’m analysing an algorithm by doing an asymptotic and experimental analysis. The asymptotic analysis went well and I concluded that my algorithm is O(nlogn). The problem is the experimental analysis.

Merge sets when two elements in common

This is the follow up of compare sets I have I want to merge the sets when there are two elements in common. For example 0,1,2 and 0,2,6 has two elements in common so merging them to form [0,1,2,6]. Again [0,1,2,6] and [2,6,7] has 2 and 6 common. so merging them and getting [0,1,2,6,7]. The final output should be :

Design for defining graphs or flowing structures

I’m trying to create a system for representing and designing graphs in an easy way. That means it should be easy to create some graphical representation from the data structure but it should also be easy to store the structure and do easy calculation on it. Easy calulations in this sence are questions like which nodes are the next nodes

Advertisement