What does this tip mean? [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I need to write such a program:
Write a program that will fill an array with 30 elements of type int randomly selected from range 0 to 10. Print the array content on the screen. Then count and print out how many times each value appears in the array (tip: histogram).
Can somebody explain what this tip means?

Histogram is a representation, you can look it up online. Simply put in your, showing an item and its frequency(no:of occurrences) in a pictorial form. Check this image
Number column has the items that are present in your array, and count column has number of times each of them occur in your array(frequency). Frequency adds up to your array size - 30. Representing an item with its frequency is a histogram. And the graph is a pictorial representation.
The tip tells you what printing representation(number and its count) is.

Related

Open-source system/service/database alternative to a search algorithm [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I have a custom algorithm (written in java) to search in a list of strings (A) the string that is the longest substring of another string (B) (the longest common substring alg it's not suited in this case because the list of strings is big 100k+ ).
EX:
B -> "sadsaf dsfsc adsa 4 sad3 dfa fgs adsafd"
A -> ["fdsdf dsa", "adsa", "4 sad3", "cdsdfds dsa", "cx d45"]
And the result is "4 sad3" since its a subtring of B and also is
longer than "adsa" which is also a substring of B
I'm trying to find an alternative to a search algorithm using a system/service/database in order to externalize this algorithm .
What i've tried till now is:
mysql but it's pretty slow and it requires at least a ssd and a powerful cpu
elasticsearch using percolate query which i didn't benchmark yet but seems promising
redis but i didn't found a way to replicate the alg using their syntax
So any suggestion regarding a system/service/database that can do this relatively decent in terms of performance is appreciated, since the more options i'll have then the better (faster) the solution will be.

finding the biggest value [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
PLEASE NOTE: I am not looking for code, but for a way how to solve this problem.
My input is world that looks like this:
The problem is, i have to find the biggest number, without using OWN variables I could declare myself, and I'm only allowed to use turnLeft(), turnRight(), move(), isLeft/Right/FrontClear(), getNumber() and putNumber() functions to move < around the world.
Could you please give me a 'verbal solution' or a hint how to do such thing?
While you cannot use any variable, note that you do have available memory (getNumber() and putNumber()). For instance, you could think about leaving a mark in positions you have already been to implement some kind of flood fill.
Further, you can fill the floor with the biggest number you have seen yet. Basically, encoding your own state in the floor.
Important questions:
Is the configuration of the maze always fixed?
Is the range of possible numbers in the floor fixed to a reasonable range (e.g. digits 1-9)?

Database which has categorized the english words into matching emotion [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
is there a database or api which has the categorized version of English words into the matching emotion?
e.g: - http://www.psychpage.com/learning/library/assess/feelings.html
One useful resource is the NRC Word-Emotion Association Lexicon compiled by Saif Mohammad. It lists the sentiments (positive, negative) and emotions (anger, anticipation, disgust, fear, joy, sadness, surprise, trust) for around 14,000 English words.
I would take a look into the topic of http://en.wikipedia.org/wiki/Sentiment_analysis If you are good with doing it in Python take a look at this demo: http://text-processing.com/demo/sentiment/ Which is able to get if a sentence is positive or negative using NLTK.

Count a 2D array within a range [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a map that I want to separately count the patterns of different numbers.
Without VB, I want to be able to create a dynamic counter that will be able to count the patterns of numbers.
For example:
I want to count how many times, even if it overlaps that this pattern occurs in the map
2 2
2 2
Counting I can see the pattern occurs six times but I'm struggling to create a simple array formula that will be able to do so
I've been told of success with and IF function with nested AND functions so I know it can be done without VB.
Use the formula
=COUNTIFS(A1:E15,2,B1:F15,2)
notice how the two areas are adjacent - one column offset from each other.
You can extend this to find two-by-two regions:
=COUNTIFS(A1:E14,2,B1:F14,2,A2:E15,2,B2:F15,2)
just be very careful about how the different ranges are offset.
An alternative way to write this which, I suspect, will be more efficient for large ranges is:
=SUMPRODUCT((A1:E14=2)*(B1:F14=2)*(A2:E15=2)*(B2:F15=2))

Interview Q- product of all elements in array without the current element [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I recently came across an interview question and was wondering what could be the solution. Any ideas to solve it are greatly appreciated.
Given an array A[N] containing N numbers. Create an array Output[N] where Output[i] is equal to the product of all the elements of A[N] except A[i].
For example Output[0] is the product of A1 to A[N-1] and Output1 is the product of A[0] and from A[2] to A[N-1].
Do this without using the division operator. Do it in O(n).
Tip: do two iterations over the array - on the first one put in each cell the product of all preceding elements and on the second one multiply this by the product of all succeding elements.

Resources