All Questions
5 questions
4
votes
3
answers
2k
views
Split function using C and dynamic memory allocation
I have programmed a function to split strings, and it gives the expected output.
I am looking forward to write better code and I was told here is a good place to start.
Here's my program:
...
1
vote
1
answer
654
views
Find out whether string A can be shifted to get string B
The task:
Given two strings A and B, return whether or not A can be shifted some
number of times to get B.
For example, if A is abcde and B is cdeab, return true. If A is abc
and B is acb, ...
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 ...
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:
...
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:
...