#Java Code large number multiplication algorithm with a divide and conquer algorithm

1 messages ยท Page 1 of 1 (latest)

ivory dove
#

Hi i need help for my college with a java code
Pseudo-code of a large number multiplication algorithm with a divide and conquer algorithm,if u know about these picture or about the algorithm please teach me.im really thankful

tardy nimbusBOT
#

<@&987246399047479336> please have a look, thanks.

tardy nimbusBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

amber sonnet
#

u sorta forgot to ask an actual question

#

as in, ur asking to ask

tardy nimbusBOT
#

Please don't ask to ask, nor only say hello, just ask your actual question right away, thanks cat_thumbs_up

If you want to read about the details of why this is better, check out:
https://dontasktoask.com/

Don't ask to ask, just ask

ivory dove
#

im really sorry for many times my english bad and im new for this discord

amber sonnet
#

no worries

#

just tell us whats unclear to u, or what question u have, and then someone will try to answer ๐Ÿ™‚

ivory dove
#

yeah thank u very much

#

I have a question about java coding about Pseudo-code of large number multiplication algorithm with divide and conquer algorithm and I have a picture if someone can help me and teach me about this coding, I'm very grateful because I don't really understand java coding yet

#

and this picture i told

amber sonnet
#

so whats ur question? is something in the picture unclear? what exactly?

#

what dont u understand?

ivory dove
#

yeah idk how to start

amber sonnet
#

well, code it step by step

ivory dove
#

cause i really confuse about it

amber sonnet
#

about what

ivory dove
#

I have this Java coding and I don't know what steps I should do again and are there any errors regarding my coding. Previously, thank you very much for helping me and sorry if I wasn't clear enough to explain it.

tardy nimbusBOT
amber sonnet
#

okay. first of all, ur supposed to create one method. not two

#

lets look at the picture

#

ur supposed to create one method, called Kali2

#

it takes 3 parameters

#

long x, long y, int n

#

and it returns long

#

so write that now

#

u can keep its content empty for a moment

#

just the method itself without body. and then share it

ivory dove
#

wait i'll try

ivory dove
ivory dove
tardy nimbusBOT
# ivory dove like this?

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

amber sonnet
#

yes, good ๐Ÿ™‚

#

now the body

#

this is the body:

#

first of all, u see that:

if ... then
  foo
else
  bar
endif
#

so. java has that as well, if-else

#

write that in ur method now

#

one big if-else

ivory dove
#

i'll try it

#

Please guide me

amber sonnet
#

whats unclear to u?

#

just write an if else

#

without body for now

#

just the if else

ivory dove
# ivory dove Please guide me

in my country if someone teaches you something you should say this as thanks for teaching you something and i say this to you

amber sonnet
#

oh okay, ur welcome ๐Ÿ™‚

ivory dove
tardy nimbusBOT
# ivory dove like this?

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

amber sonnet
#

yes, very good

#

only the else part missing

#

<- means =

#

so like int s = n / 2;

#

the 10^s u can do with Math.pow(10, s)

ivory dove
#

is there any other way besides using math.pow? because my class is not there yet and my lecturer might get it wrong if i use math.pow

amber sonnet
#

u can create a method that multiplies 10 * 10 * ... in a loop

#

i guess

ivory dove
#

i apologize in advance. is it correct to use divide and conquer algorithm?

amber sonnet
#

i dont understand

ivory dove
#

I apologize in advance because you don't understand. As I said earlier, in the photo I sent it is a large number multiplication algorithm with a divide and conquer algorithm and what I am asking is whether the coding you taught me uses the divide and conquer algorithm?

tardy nimbusBOT
# ivory dove like this?

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

ivory dove
tardy nimbusBOT
amber sonnet
#

the divide and conquer part is the actual algorithm, the method ur writing

#

has nothing to do with the power thing

#

try out ur pangkat method

#

don't just code. constantly try it out

#

otherwise u end up with a big mess full of bugs

#

the pangkat method doesn't work at all right not. u have to fix it

ivory dove
tardy nimbusBOT