All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
27 views

What is the relation between an algorithm and its implementation at the level of code?

Is there any isomorphism or equivalence relation? What strictly bind these two together?
1
vote
0answers
52 views

Converting (reverse-engineering) Turing machine into program or most concise algorithm?

It is known that every program or every algorithm can be converted to Turing machine. But what about the reverse process? Is there algorithm (or research trend that considers such algorithm) to ...
2
votes
1answer
66 views

How do I count the exact number of executed commands for a MIPS program?

I want to know what the best way is to count the number of executed commands for a given MIPS program. Let's say we're given a simple for loop that counts from $0$ to $100$. For this I would write the ...
1
vote
0answers
31 views

directed edges in an undirected graph [duplicate]

Undirected graph is given which has M edges and N vertices we have to convert every edge from u−v to u→v or v→u such that the total outdegree of every vertex is even. For example, consider a graph ...
0
votes
1answer
573 views

What is the difference between “algorithm,” “process” and “program”?

I am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them? Thank you.
-1
votes
1answer
30 views

General algorithm for generating a description of the language it is written in [closed]

Does there exist a general algorithm which can output a finite and complete description of the (programming) language in which it is written, if it is given the permission to execute programs in that ...
7
votes
1answer
850 views

The C3 linearization algorithm for method resolution in multiple inheritance OO languages: Looking for a justification for some implementation detail

According to this description of Python's method resolution order (mro), a.k.a. C3 linearization, the algorithm can be described recursively as follows: ...
1
vote
0answers
25 views

Creating a self-affine fractal on L-systems

Hi I would like to create a self-affine fractal on L-Systems. The axiom I have created is FF-GGG-GG-GGG++GGG+GG-GGG+GG+GGG+FF++ffGG+GGG+FF+GGG which creates the image below At each stage I would like ...
2
votes
1answer
25 views

Local variables get assigned global addresses based upon call tree

When working with certain low-powered / embedded CPUs that are bad at using the stack, I need to avoid putting local variables there, instead opting to make them static variables. But this can waste a ...
1
vote
0answers
30 views

How can one find a job after working as a freelancer? [closed]

I was looking for a StackExchange site that would be the best for this question, so if this isn't the best place, please feel free to redirect me elsewhere. I have worked as a Freelancer somewhat out ...
1
vote
0answers
48 views

Should I improve my computer science knowledge by focusing on one skill at a time, or doing a little bit of everything more frequently? [closed]

I'm currently learning things like algorithms, data structures, machine learning and some programming languages. Should i distribute my work or should i focalized for a certain period on one thing, ...
8
votes
7answers
526 views

As a Teacher: Choosing a suitable programming language

I'm not sure if it's the right place for this question. Sorry if going a bit off-topic. Choosing a suitable Language for the first programming course is one of the most important things that every ...
-1
votes
1answer
353 views

Calculating the difference between two dates in different timezones in hours and minutes [closed]

I need to calculate the difference between two dates in hours and in minutes which is what the code below does. The only issue I have is that the dates and the location (timezone) has to be input by ...
2
votes
0answers
22 views

Detect assigned variables in expression in linear time

Let's say I have the lambda calculus extended with set! for assignment. ...
-2
votes
1answer
312 views

Trying to code for calculating cosine series [closed]

I was trying to calculate cosine series : cos x = 1 - x^2/2! + x^4/4! - x^8/8! .... , where x is in radians: include iostream include math.h using namespace std; long factorial (long num) { if ...
3
votes
1answer
52 views

What algorithm solves high-order unification for untyped terms in most cases?

High-order pattern matching is an undecidable problem. That means there is no algorithm that, given an equation a => b, where ...
2
votes
0answers
145 views

Memory testing algorithms? [closed]

What am I doing? I have been digging more and more and googling more than often finding very small amount of results I am trying to make a RAM testing program that can do memory testing with the ...
6
votes
1answer
4k views

Complete examples of program correctness proofs

Does anyone have any complete example of a proof of program correctness? I'm talking about something that includes the usual predicate, base case, inductive hypothesis, and inductive step. But also ...
6
votes
10answers
45k views

Computer Program vs. Algorithm

It's said that a program include algorithms, however if we refer to their definition, an algorithm is a sequence of instructions written to perform a specified task and a computer program is also a ...
-1
votes
2answers
406 views

Are “data structures” part of algorithms or of programming languages?

I often heard that "program = algorithm + data structure". But I notice that It seems to me that a data structure is (or may be) just a data type or extension thereof. Is it correct? But a data type ...
-1
votes
1answer
149 views

Implementability of a (abstract) data structure/type? [closed]

Do people consider the implementability of a (abstract) data structure or a data type, just like people do for implementability/computability of an algorithm? By implementability, I mean if a (...
2
votes
2answers
114 views

Is there a name for defining recursive functions as an infinite list of input/output pairs?

Recursive functions are usually defined by directly calling a function inside its own body. Nat = Z | S Nat double Z = Z double (S x) = S (S (double x))) What if,...
1
vote
2answers
64 views

Is there a decidable algorithm to compose two well-behaved recursive functions that work on a recursive tree datatype?

Let the following datatype be defined: data T = A | B T | C T T That is, B, B T, B (B T), C A A, C (B T) A and so on all are ...
7
votes
2answers
117 views

How to find the minimal description for an array?

The following array occupies 10000 slots in memory: a = [0,1,2,3,4,5,6,7,8,9,10,...,10000] But one could easily represent the same array as: ...
18
votes
2answers
3k views

Type-checking algorithms

I am starting a personal bibliographic research on type-checking algorithms and want some tips. What are the most commonly used type-checking algorithms, strategies and general techniques? I am ...