Comments (6)
@priyamm
your solution has complexity of nlogn which can be optimized further to n. If you are ok, would like to contribute.
from java-jet.
@saichandernagamalla Whats would be your logic assuming no extra space taken?
from java-jet.
@priyamm raised a PR #66 . Time complexity = n, Space complexity =n.
My implementation has a map which stores count of characters in str1. While traversing str2, I will be removing characters of str2 from map count. Finally, count of each character in map should be zero to say it an anagram, else not an anagram.
I believe that importance of time complexity > space complexity. As current day devices has much RAM space, so time complexity plays major role.
Correct me if i'm missing anywhere.
from java-jet.
@saichandernagamalla Modern day devices are quite faster too, Octa-core processors with parallel and multithreading can easily beat out the speed. It depends upon the circumstances whether we should be creating more variables and handle memory leaks if present.
For interview, it depends upon the interviewer which complexity (s)he choses.
from java-jet.
@ShivangiSingh17 When are you planning to merge the open PRs?
from java-jet.
@priyamm I will merge the PRs soon. Thanks for your concern
from java-jet.
Related Issues (20)
- Palindrome number HOT 2
- String Palindrome HOT 6
- CONTRIBUTING.md HOT 5
- Duplicate Characters HOT 2
- Divisibility HOT 2
- Middle elements HOT 6
- Star the repo HOT 1
- Sum for fun HOT 2
- Avoiding deadlock in Java HOT 2
- Sort array using quicksort HOT 2
- Print all permutations of String HOT 6
- Prime number HOT 5
- Square root of the number HOT 5
- Postorder traversal without recursion HOT 2
- Leap year HOT 6
- Factorial HOT 5
- Middle element HOT 1
- Insertion Sort HOT 2
- Bubble sort HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-jet.