473,671 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reverse a string "in place"

I've asked myself this question in the past but couldn't afford more
time to it (I program other languages for my bread and butter), so I'll
ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean without
using additional memory?

Dec 23 '05 #1
10 5311
Water Cooler v2 said:
I've asked myself this question in the past but couldn't afford more
time to it (I program other languages for my bread and butter), so I'll
ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean without
using additional memory?


What does the qualifier "in place" mean here?
?hat does the qualifier "in place" mean hereW
?eat does the qualifier "in place" mean herhW
?ert does the qualifier "in place" mean heahW
?ere does the qualifier "in place" mean teahW
?ere does the qualifier "in place" mean teahW
?ere noes the qualifier "in place" mead teahW
?ere naes the qualifier "in place" meod teahW
?ere naes the qualifier "in place" meod teahW
?ere naem the qualifier "in place" seod teahW
?ere naem the qualifier "in place" seod teahW
?ere naem "he qualifier "in placet seod teahW
Dec 23 '05 #2
Richard Heathfield wrote:
Water Cooler v2 said:

I've asked myself this question in the past but couldn't afford more
time to it (I program other languages for my bread and butter), so I'll
ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean without
using additional memory?

What does the qualifier "in place" mean here?
?hat does the qualifier "in place" mean hereW
?eat does the qualifier "in place" mean herhW
?ert does the qualifier "in place" mean heahW
?ere does the qualifier "in place" mean teahW
?ere does the qualifier "in place" mean teahW
?ere noes the qualifier "in place" mead teahW
?ere naes the qualifier "in place" meod teahW
?ere naes the qualifier "in place" meod teahW
?ere naem the qualifier "in place" seod teahW
?ere naem the qualifier "in place" seod teahW
?ere naem "he qualifier "in placet seod teahW
.
.
.

I hope you can see how this is going.

Badly. Whaet? :-)

S.
Dec 23 '05 #3
Skarmander said:
Richard Heathfield wrote:
?ere naem "he qualifier "in placet seod teahW
.
.
.

I hope you can see how this is going.

Badly. Whaet? :-)


I *knew* I should have written code to do that. (sigh)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Dec 23 '05 #4
Cool! Thanks a bunch, Richard.

Dec 23 '05 #5
Richard Heathfield <in*****@invali d.invalid> wrote:
Skarmander said:
Richard Heathfield wrote:
?ere naem "he qualifier "in placet seod teahW
.
.
.

I hope you can see how this is going.

Badly. Whaet? :-)


I *knew* I should have written code to do that. (sigh)


Yeah, every Anglo-Saxon fule noes that that should be "Hwaet!".

Richard
Dec 23 '05 #6
Water Cooler v2 wrote:

I've asked myself this question in the past but couldn't afford
more time to it (I program other languages for my bread and
butter), so I'll ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean
without using additional memory?


Almost. It means returning the result in the same storage in which
it arrived. This doesn't prevent using temporary auxiliary memory.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell. org/google/>
Dec 23 '05 #7

Chuck F. wrote:
Water Cooler v2 wrote:

I've asked myself this question in the past but couldn't afford
more time to it (I program other languages for my bread and
butter), so I'll ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean
without using additional memory?


Almost. It means returning the result in the same storage in which
it arrived. This doesn't prevent using temporary auxiliary memory.


Is there even a way you could do it without temporary memory? I can't
think of one.

Dec 23 '05 #8
On 2005-12-23, gooch <go******@comca st.net> wrote:

Chuck F. wrote:
Water Cooler v2 wrote:
>
> I've asked myself this question in the past but couldn't afford
> more time to it (I program other languages for my bread and
> butter), so I'll ask now since it's never too late.
>
> What does the qualifier "in place" mean here? Does that mean
> without using additional memory?


Almost. It means returning the result in the same storage in which
it arrived. This doesn't prevent using temporary auxiliary memory.


Is there even a way you could do it without temporary memory? I can't
think of one.


You could use the xor trick.
Dec 23 '05 #9
"Chuck F. " <cb********@yah oo.com> wrote in message
news:pY******** *************** *******@maineli ne.net...
Water Cooler v2 wrote:
I've asked myself this question in the past but couldn't afford
more time to it (I program other languages for my bread and
butter), so I'll ask now since it's never too late.

What does the qualifier "in place" mean here? Does that mean
without using additional memory?


Almost. It means returning the result in the same storage in which
it arrived. This doesn't prevent using temporary auxiliary memory.


But "in place" is usually taken to mean "with *constant* additional memory",
ie the amount of "temporary auxialliary memory" cannot depend on the length
of the string.

Alex
Dec 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1404
by: Ioannis Vranos | last post by:
Will "STL .NET" of VS 2005 include a fully managed std::string? -- Ioannis Vranos
12
3218
by: Pascal | last post by:
hello and soory for my english here is the query :"how to split a string in a random way" I try my first shot in vb 2005 express and would like to split a number in several pieces in a random way without success. for example if the number is 123 456 : i would like to have some random strings like theese : (12 * 10 000) + (345 * 10) + (6*1) or (123*1 000)+(4*100)+(5*10)+(6*1) etc...
1
1792
by: Ducknut | last post by:
Not so much a problem as a discussion. I am currently in the early stages of designing a database to hold a bunch of water quality data (e.g., concentrations of heavy metals in drinking water). Water samples will be sent to a lab for analysis and the lab will send back a report (usually in excel or .txt format), that data will be imported into Access. If the concentration of a heavy metal is lower than the detectable limit of the analysis, the...
3
12007
by: Sugandh Jain | last post by:
Hi, I am using property like this.. private DateTime? _propName; public DateTime? PropName { get { return _propName; }
9
2847
by: chutsu | last post by:
hi I got a simple program, and I was wondering how do you check if the string in an array = a string. For example if I put "APPLE" in array Array then how can I check it with a if statement. if (Array == 'APPLE'){ do something; } or do I need to use a different method to check?
9
2133
by: Ronald S. Cook | last post by:
Can I write If MyString = "Apple" Or MyString = "Orange" Or MyString = "Pear" Then to something more compact like If MyString In ("Apple", "Orange", "Pear") Then My last line obviously doesn't work but maybe I'm close?
3
2753
by: davidj411 | last post by:
why does this occur when using the python windows extensions? all string are prefixed by a lowercase "u". is there a newsgroup explicitly for python windows extensions? example of output below. SMBIOSBIOSVersion:u'A16' SMBIOSMajorVersion:2 SMBIOSMinorVersion:3 SMBIOSPresent:True
0
1142
by: Kris Kennaway | last post by:
If I do the following: def mmap_search(f, string): fh = file(f) mm = mmap.mmap(fh.fileno(), 0, mmap.MAP_SHARED, mmap.PROT_READ) return mm.find(string) def mmap_is_in(f, string): fh = file(f)
0
1116
by: Gabriel Genellina | last post by:
En Thu, 29 May 2008 19:17:05 -0300, Kris Kennaway <kris@FreeBSD.org> escribió: Looks like you should define the sq_contains member in mmap_as_sequence, and the type should have the Py_TPFLAGS_HAVE_SEQUENCE_IN flag set (all in mmapmodule.c) -- Gabriel Genellina
15
1137
by: David C. Ullrich | last post by:
Luckily I tried it before saying no, that's not how "in" works: True False Is there a reason for the inconsistency? I would have thought "in" would check for elements of a sequence, regardless of what sort of sequence it was...
0
8478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8397
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8919
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6230
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2813
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.