Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
7 answers
305 views

Breaking a string expression in operator and operands

Requesting for a code review for a scala implementation. Problem Given an expression string made of numbers and operators +,-,/,* , break it in a list of Integer or ...
vikrant's user avatar
  • 405
2 votes
3 answers
129 views

Is My Function to Find Triplets in Scala running in O(N^2)

Given the classical problem to find triplets that sum to zero in an array. Is my Scala implementation correct and executed in O(N^2)? If yes, why? Can someone make a running time analysis. What other ...
Filipe Miranda's user avatar
2 votes
0 answers
319 views

KMP algorithm in scala

I implemented KMP pattern matching algorithm in Scala. My code works but it looks more imperative and a scala translation of C/C++ implementation. I am not able to figure out how to manage multiple ...
vikrant's user avatar
  • 405
0 votes
1 answer
533 views

Print words in decreasing order of frequency in Scala

Given a string print its words in decreasing order of frequency. Example: i/p - "aa bbb ccc aa ddd aa ccc" o/p - aa,ccc,ddd,bbb Scala: ...
vikrant's user avatar
  • 405
1 vote
1 answer
503 views

Check Is Anagram Scala HashMap based implementation

Here is the HashMap based implementation of the function checking whether two strings are anagrams: Example: ...
Vitalii Zinchenko's user avatar
2 votes
2 answers
630 views

A Scala Maze Generator in Functional Style

I'm wondering if there is more I can do to incorporate more idiomatic scala and functional programming principles. I know the maze itself is mutable but i didn't see an easy solution to making it ...
j will's user avatar
  • 155