Questions tagged [sequence]
The sequence tag has no usage guidance.
24
questions
-1
votes
3
answers
184
views
Running series of steps depending on implementation
What is the "best way" to implement something like this:
I have a list of steps that will be iterated and ran for an IContext instance. But, some steps will only apply to a specific instance ...
0
votes
2
answers
235
views
Which is the best data structure to use when you want to randomly pick elements & use them, but also delete them after use
I have 1000 lines in a text file. I want to read them into some data structure[DS].
After reading them, I will be randomly picking 50 lines from the DS (using a Random Number Generator). Next time 50 ...
0
votes
1
answer
104
views
How to return an new Object as Value ?[Sequence Diagram]
within the sequence diagram it is possible to return a value, with return of a method edge, however this is usually done with a simple numeric or string value. Is it possible to return a whole object? ...
-1
votes
1
answer
103
views
How to produce a *bidirectional* infinite sequence?
Infinite sequences with a specific starting point are well-understood by now. For example, the Fibonacci numbers can be programmed like this:
def fibonacci():
a, b = 0, 1
while True:
...
2
votes
3
answers
686
views
Algorithm for optimizing text compression
I am looking for text compression algorithms (natural language compression, rather than compression of arbitrary binary data).
I have seen for example An Efficient Compression Code for Text ...
1
vote
1
answer
765
views
How do I create a comparable checksum of a number sequence?
Sorry if the title is confusing, but here's an example to illustrate what I'm trying to accomplish.
I would like to create a 'checksum' or ID grouping of similar number sequences, so that when you ...
3
votes
1
answer
308
views
Design patterns for handling patterns in object sequences
There some times appears a task when you have a sequence of object and you need perform some action when a particular pattern (subsequence?) occurs.
As more concrete example we can imagine a log ...
0
votes
1
answer
1k
views
Algorithm to create a superincreasing sequence
I am building an implementation of the [Merkle-Hellman Knapsack Cryptosystem] for my study.(https://en.wikipedia.org/wiki/Merkle%E2%80%93Hellman_knapsack_cryptosystem)
One of the things I would like ...
-1
votes
1
answer
1k
views
Find missing number in sequence in string [closed]
I have a string that contains numbers in sequence. There are no delimiters between numbers. I have to find missing number in that sequence. For example:
176517661768 is missing the number: 1767
...
0
votes
3
answers
96
views
How to optimize iterable queries with external arguments
I will use C# here as an example, but my question is about any language.
My question is from framework to compiler perspective (i.e the solution can be by implementing given idea inside compiler)
...
4
votes
3
answers
709
views
Determine frequency-range that matches closest to input list of frequencies
Since this question is not about "code not working", I'm asking my first question here instead of StackOverflow. Inform me if any required information is missing from the question.
Setup:
I have two ...
2
votes
1
answer
264
views
Figuring out the mean of a stream of data, disregarding values that are way off bounds
I have a stream of integer data and want to perform some statistical analysis on it. I want to calculate the mean and the standard deviation of it. So far it isn't hard, but keep in mind that I am ...
2
votes
2
answers
502
views
Shuffle/Randomize a collection without knowing the number of items? [closed]
Let's say I have a sequence of items of unknown length, n. I want to randomize the order of this sequence without having to go through the entire sequence. Are there any algorithms that can do this?
...
3
votes
1
answer
519
views
Why sequences are recommended as conventional interfaces?
From the reference of berkeley's version of sicp text, It is mentioned that:
Expressing programs as sequence operations helps us design programs that are modular. That is, our designs are ...
-1
votes
2
answers
3k
views
'Tuple' vs 'List' operations in python
Only two operations are allowed on tuple, as shown below.
Operations like insert / delete at an index is not allowed. I learnt that tuple is an immutable data model.
list allows insert and delete ...
0
votes
1
answer
686
views
Number of sequences when no adjacent items can be the same
I came across this one problem,
There is a particular sequence only uses the numbers 1, 2, 3, 4 and no two adjacent numbers are the same.
Write a program that given n1 1s, n2 2s, n3 3s, n4 4s ...
3
votes
2
answers
414
views
Strategy game, how do I calculate the parallel actions?
I am building a strategy game where multiple units(5 - 20) fighting each other.
I have a game logic that calculate all the actions that been done on each turn, and send it to the game engine to ...
0
votes
4
answers
1k
views
Separating merged array of arithmetic and geometric series [closed]
Given an array of positive integers in increasing order. Separate them in two series, an arithmetic sequence and geometric sequence. The given array is such that a solution do exist.
The union of ...
1
vote
1
answer
5k
views
how could I draw the database transaction commit in the sequence diagram
How could I draw the database transaction commit in the sequence diagram?
EDIT
I want to draw in sequence diagram database transaction commit/rollback process
6
votes
1
answer
26k
views
Difference between statechart and sequence diagram
I realise these two diagrams are very similar, with the obvious difference one models the sequence of a certain function, whilst the other models the state throughout a function being carried out.
...
1
vote
1
answer
2k
views
What is a combined fragment in a UML Sequence Diagram?
Everything is in the question. I just discover this new feature and I don't really understand what it stands for. I know that it can represent loop, alternative in the sequence diagram.
Can someone ...
0
votes
2
answers
211
views
How to do this in Standard UML?
In the below Sequence diagram, when the user have entered the Username and Password, I have to do the authentication. Now you can see two details valid details and invalid detail in the diagram , ...
5
votes
2
answers
271
views
Is there a common mathematical symbology for collections?
I am being asked to define several of my algorithms in mathematical terms to describe my work to a customer. I am trying to determine if anybody knows whether common operators for collections like ...
5
votes
4
answers
2k
views
What's stopping Oracle from supporting identity (auto-numeric) columns? [closed]
EDIT: As gavenkoa's answer points out, Oracle Database 12c (released a couple of years after this question was asked) has support for Identity Columns.
As far as I know, Oracle's RDBMS is one of the ...