Click here to Skip to main content
15,881,516 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: finger search algorithm using data structure in c-program Pin
Richard MacCutchan8-Oct-14 6:18
mveRichard MacCutchan8-Oct-14 6:18 
GeneralRe: finger search algorithm using data structure in c-program Pin
harold aptroot8-Oct-14 6:37
harold aptroot8-Oct-14 6:37 
GeneralRe: finger search algorithm using data structure in c-program Pin
Member 111385019-Oct-14 3:33
Member 111385019-Oct-14 3:33 
QuestionHow do I manipulate a series of data chart points against their Y-Axis so they are evenly distributed along the axis? Pin
Brady Kelly20-Sep-14 21:39
Brady Kelly20-Sep-14 21:39 
AnswerRe: How do I manipulate a series of data chart points against their Y-Axis so they are evenly distributed along the axis? Pin
Bernhard Hiller21-Sep-14 21:32
Bernhard Hiller21-Sep-14 21:32 
GeneralRe: How do I manipulate a series of data chart points against their Y-Axis so they are evenly distributed along the axis? Pin
Brady Kelly21-Sep-14 22:00
Brady Kelly21-Sep-14 22:00 
GeneralRe: How do I manipulate a series of data chart points against their Y-Axis so they are evenly distributed along the axis? Pin
Bernhard Hiller22-Sep-14 2:03
Bernhard Hiller22-Sep-14 2:03 
QuestionOptimizing memory usage Pin
CDP180214-Sep-14 2:14
CDP180214-Sep-14 2:14 
For my old computer I need an assembler which is able to take assembled code from a library and link it together in the smallest possible combination.

One 'speciality' of the old CDP1802 processor will force me to write the assembler and linker myself. There are two types of branching instructions: long branches and short branches. Long branches use full 16 bit addresses, but will cause timing issues with the graphics chip. This is an ancient hardware bug.

This is the reason why i must use short branches with short 8 bit addresses. The upper 8 bits are just assumed to remain the same as in the instruction's address. This way memory is segmented into 256 byte blocks. It's not a very strict segmentation as the code can run across the boundaries without any consequences, You just can't loop back with a short branch and long branches can't be used.

The linker will have to puzzle together snippets of code and data with this in mind. At the same time I must be sure that memory usage is as low as possible in the end. My old computer has only 4k RAM, and more than 16k is quite unusual.

The only thing I can think of is to make a memory map of each possible combination and take the one which needs the least amount of memory. There are easily hundreds of small code snippets to be linked and blindly testing every combination will be very slow and inefficient.

First thought: Build a tree with only valid options and then find the branch with the lowest byte count. This is alresy better than brute force, but I hope there is still a more elegant algorithm for this.
The language is JavaScript. that of Mordor, which I will not utter here

I hold an A-7 computer expert classification, Commodore. I'm well acquainted with Dr. Daystrom's theories and discoveries. The basic design of all our ship's computers are JavaScript.

AnswerRe: Optimizing memory usage Pin
Daniel Pfeffer15-Sep-14 22:41
professionalDaniel Pfeffer15-Sep-14 22:41 
GeneralRe: Optimizing memory usage Pin
harold aptroot16-Sep-14 6:28
harold aptroot16-Sep-14 6:28 
QuestionHow .NET CLR understands More languages Pin
pitchaiyan12-Sep-14 5:12
pitchaiyan12-Sep-14 5:12 
GeneralRe: How .NET CLR understands More languages Pin
PIEBALDconsult12-Sep-14 5:31
mvePIEBALDconsult12-Sep-14 5:31 
GeneralRe: How .NET CLR understands More languages Pin
pitchaiyan12-Sep-14 5:42
pitchaiyan12-Sep-14 5:42 
RantRe: How .NET CLR understands More languages Pin
George Jonsson14-Sep-14 16:23
professionalGeorge Jonsson14-Sep-14 16:23 
AnswerRe: How .NET CLR understands More languages Pin
Richard MacCutchan12-Sep-14 5:58
mveRichard MacCutchan12-Sep-14 5:58 
QuestionAlgorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 1:21
Member 110631236-Sep-14 1:21 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 2:32
harold aptroot6-Sep-14 2:32 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 4:01
Member 110631236-Sep-14 4:01 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 4:10
harold aptroot6-Sep-14 4:10 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 4:14
Member 110631236-Sep-14 4:14 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 4:18
Member 110631236-Sep-14 4:18 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 4:49
harold aptroot6-Sep-14 4:49 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 6:33
Member 110631236-Sep-14 6:33 
GeneralRe: Algorithm to find a given number is prime or not. Pin
harold aptroot6-Sep-14 7:22
harold aptroot6-Sep-14 7:22 
GeneralRe: Algorithm to find a given number is prime or not. Pin
Member 110631236-Sep-14 7:53
Member 110631236-Sep-14 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.