|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
operators and operands
hello
according to my lecturer there are 9 distinct operators and 6 distinct operands in the following pseudo code: max:=A[i]; i=2; while i <= 10 do begin if A[i] > max then max:=A[i]; i:=i+1 end could someone please tell me how he got those numbers (6 and 9) ? thank you in advance. fmh002 |
|
#2
|
||
|
There are 6 operands. There's an implicit operator in A[i], the addition of operand 'i' to the base address of the (operand) array A; I don't see that it's distinct from the '+' in 'i+1', though. He may think that <= is two operators, but if he does, he would be mistaken; it's a single assembly-language instruction, the inverse of '<'.
|
|
#3
|
|||
|
|||
|
i found the correct answer already.
thank you. |
|
#4
|
|||
|
|||
|
Hi,
I'm new to programming and I need some help with this: I need to read from some 15 different text files, on disk, each having a set of ordered integers. I then need to combine all of them to form one ordered liste containing all the elements from the 15 text files. I also need to write the result in a file. I have to use a heap-MIN algorithm with a time O(n log k), where k is the number of files, and n is the number of elements in the 15 files (400 elements). |
|
#5
|
||||
|
||||
|
Quote:
Please post this as a new thread. Please read "How to Post A Question" before posting next time. Thank you.
__________________
~~ Peter ~~ ( My Blog: It's exactly like normal nerdiness, but completely different. ) :: ( Supporter of the EFF & FSF ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) |
|
#6
|
||
|
Also avoid cross-posting. You put this same thing in C/C++. Didn't like the answers over there, or what?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Software Design > operators and operands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|