Why don't you try what newton posted. I know hash tables but never used them.This is more like n^3, definitely not o ( n ), you can see the nested loops.
How are you with hash tables?
Why don't you try what newton posted. I know hash tables but never used them.This is more like n^3, definitely not o ( n ), you can see the nested loops.
How are you with hash tables?
I don't get what is the problem? Cm value is correctGuys new to programming and need help
Imgur: The most awesome images on the Internet
Getting some different value in cm But in C it works just fine but in C++ i get this need help please
idk whats the problem hereI don't get what is the problem? Cm value is correct
Now can anybody explain me how we get these values ? especially logn, nlogn and n!.
my calculation is that
10^6 = 1 sec.
n = 10^6.
n^2 = 10^12 but in solution its 10^3
n^3 = 10^18 but in solution its 10^2
n^1/2 = 10^3 but in solution its 10^12
I don't know how you are solving that... I'd do this with inequalities...I'm having really hard time understanding Analysis of algorithms, can any body direct me to a book or tutorial from where i can get a good hold of this subject.
I also have a question
Solution for first two
Code:Now can anybody explain me how we get these values ? especially logn, nlogn and n!. my calculation is that 10^6 = 1 sec. n = 10^6. n^2 = 10^12 but in solution its 10^3 n^3 = 10^18 but in solution its 10^2 n^1/2 = 10^3 but in solution its 10^12
Have you done this? Is this a class assignment? ?Guys need help in the following C++ Program
Write a program to declare a 2-dimensional Matrix A of size R X C, and input values in all elements then do the following
a) Find the Smallest and Largest Element in Matrix A
b) Find Sum of each Row and Column of Matrix A
c) Find the Sum of the Diagonals of matrix A.
d) Find Transpose of Matrix A
e) Check wether the Matrix you entered is an identity matrix or not.
what help you need in this assignment? understanding how it is solved ? bcz this basic matrix operation in c++ code is already available in many books and internet .Guys need help in the following C++ Program
Write a program to declare a 2-dimensional Matrix A of size R X C, and input values in all elements then do the following
a) Find the Smallest and Largest Element in Matrix A
b) Find Sum of each Row and Column of Matrix A
c) Find the Sum of the Diagonals of matrix A.
d) Find Transpose of Matrix A
e) Check wether the Matrix you entered is an identity matrix or not.
Have you done this? Is this a class assignment? ?
Sent from my LG-H818 using Tapatalk
yes it was a class assignment and have already done it but thanks for your timewhat help you need in this assignment? understanding how it is solved ? bcz this basic matrix operation in c++ code is already available in many books and internet .
well matrix is btw just playing with array indexes nothing complex ,
So I wanted to ask is there a way to sort a HashSet without converting the HasSet to a TreeSet in java?
I have a couple of names that I want to order, but only using HashSets.
I tried with treeset, it works. But the problem was there were two surnames in my Set. If I convert it to Treeset, it does sort it but removes one of the names with the same surname. Weirdly, it didn't do that if the first names were same. Regardless, I suppose I have to implement a comparator to do, I suppose? Or convert it to an ArrayList and use collections.sort?Unlike other collections which follow the rule of collection.sort(list) the hashset cannot use this because it contradicts with the hashset implementation.
You will need to put the items into another collection like array, treeset etc
Reference : HashSet (Java Platform SE 7 )
please post a sample set of the items which aren't being sorted correctly.I tried with treeset, it works. But the problem was there were two surnames in my Set. If I convert it to Treeset, it does sort it but removes one of the names with the same surname. Weirdly, it didn't do that if the first names were same. Regardless, I suppose I have to implement a comparator to do, I suppose? Or convert it to an ArrayList and use collections.sort?
please post a sample set of the items which aren't being sorted correctly.
Friends f = new Friends(); f.add(new Person("Locke", "Lamora"));
System.out.println(f);
Set<Person> st = new HashSet<>();
st.addAll(Arrays.asList(
new Person("Jean", "Tannen"),
new Person("Calo", "Sanza"),
new Person("Galdo", "Sanza"),
new Person("Sabetha", "Belacoros"),
new Person("Ezri", "Delmastro")
));
f.add(st);
Which name is being used for the sort? I'm assuming it's using the surname. You really should have your own comparator for this situation. In your comparator decide the order based on the last name, in case if both the last names are the same then decide on the first name; if the first names are the same too then retain their order in the sorted list. Such a comparator will give you a correct output.Now, the 'Sanza' surname is appears twice here. And if sort it using a treeset, one of the 'Sanza' names will be omitted. But if I change 'Jean Tannen' to 'Locke Tannen'. I now have two names with the same firstname 'Locke', and they will not be omitted by the treeset.Spoiler: showCode:Friends f = new Friends(); f.add(new Person("Locke", "Lamora")); System.out.println(f); Set<Person> st = new HashSet<>(); st.addAll(Arrays.asList( new Person("Jean", "Tannen"), new Person("Calo", "Sanza"), new Person("Galdo", "Sanza"), new Person("Sabetha", "Belacoros"), new Person("Ezri", "Delmastro") )); f.add(st);
why you are paying american rates in Pakistan. Search cheaper region like Turkey. 13k for 13 months. Ms does not careShadowdragoo said:no idea how that is a steal by wasting 3500 rupees per month and for games that are removed before you can finish them off.xbox gamepass is garbage with no local prices
There are no such thing as "bad design" bro, its all "artistic vision" nowEternalBlizzard said:Is it just me or people lately seem to defend every bad game design decision made by the devs and try to give bullshit reasons for that? Or perhaps it's because I'm on reddit and discord