Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 17th, 2004, 08:25 AM
fmh002 fmh002 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 38 fmh002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m
Reputation Power: 6
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

Reply With Quote
  #2  
Old March 17th, 2004, 03:05 PM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Permanently Banned
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 7,351 DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 19 h 39 m 7 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
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 '<'.

Reply With Quote
  #3  
Old March 18th, 2004, 04:41 AM
fmh002 fmh002 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 38 fmh002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m
Reputation Power: 6
i found the correct answer already.

thank you.

Reply With Quote
  #4  
Old April 1st, 2004, 02:03 PM
nfrino nfrino is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 10 nfrino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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).

Reply With Quote
  #5  
Old April 1st, 2004, 05:26 PM
codergeek42's Avatar
codergeek42 codergeek42 is offline
[Insert clever comment here.]
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jul 2003
Location: Anaheim, CA (USA)
Posts: 6,458 codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)codergeek42 User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 39542 Folding Title: Starter FolderFolding Points: 39542 Folding Title: Starter Folder
Time spent in forums: 1 Month 1 Week 6 Days 21 h 3 m 55 sec
Reputation Power: 1231
Send a message via ICQ to codergeek42 Send a message via AIM to codergeek42 Send a message via Yahoo to codergeek42 Send a message via Google Talk to codergeek42
Quote:
Originally Posted by nfrino
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).

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 )

Reply With Quote
  #6  
Old April 1st, 2004, 10:46 PM
DaWei_M's Avatar
DaWei_M DaWei_M is offline
Permanently Banned
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jan 2004
Location: Central New York. Texan via Arizona, out of his element!
Posts: 7,351 DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level)DaWei_M User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 19 h 39 m 7 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Also avoid cross-posting. You put this same thing in C/C++. Didn't like the answers over there, or what?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > operators and operands


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT