linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A C program to merge content of 2 binary tree
@ 2004-05-11  3:41 Jogesh Kanojia
  2004-05-11  4:35 ` Help in Shell script Jogesh Kanojia
  0 siblings, 1 reply; 6+ messages in thread
From: Jogesh Kanojia @ 2004-05-11  3:41 UTC (permalink / raw)
  To: Linux-C-Programming (E-mail)

Hi
can any body help me in writing a C program to merge the contents of two
binary search trees into one. What are the time and storage complexities of
program?

i am no that good in data structure


Regards,
Jogesh Kanojia,
Sr. Software Engineer.
Patni Computer Systems Limited
Mobile:- +91 9820275701
Tel:+91-22-27611090 Ext.4018



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Help in Shell script
@ 2004-05-11  4:35 ` Jogesh Kanojia
  2004-05-11  5:02   ` A C program to merge content of 2 binary tree, etc Jeff Woods
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jogesh Kanojia @ 2004-05-11  4:35 UTC (permalink / raw)
  To: Linux-C-Programming (E-mail)

Hi

I want shell programs for the following:
(a)  To find the smallest number among the 3 numbers given.
(b)  To check whether the given string is a palindrome or not.
(c)  To sort the given list of numbers in descending order.
(d)  To check, how many times a given substring occurs in a given main
string.
(e)  To find the factorial of a given number

If any one have this do send it to me

Regards,
Jogesh Kanojia,
Sr. Software Engineer.
Patni Computer Systems Limited
Mobile:- +91 9820275701
Tel:+91-22-27611090 Ext.4018



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A C program to merge content of 2 binary tree, etc.
  2004-05-11  4:35 ` Help in Shell script Jogesh Kanojia
@ 2004-05-11  5:02   ` Jeff Woods
  2004-05-11  5:47   ` Help in Shell script John T. Williams
  2004-05-11 19:40   ` Jan-Benedict Glaw
  2 siblings, 0 replies; 6+ messages in thread
From: Jeff Woods @ 2004-05-11  5:02 UTC (permalink / raw)
  To: Jogesh Kanojia; +Cc: Linux-C-Programming (E-mail)

Hello, Jogesh.

At 5/11/2004 09:11 AM +0530, Jogesh Kanojia wrote:
>can any body help me in writing a C program to merge the contents of two
>binary search trees into one. What are the time and storage complexities of
>program?
>
>i am no that good in data structure

At 5/11/2004 10:05 AM +0530, Jogesh Kanojia wrote:
>I want shell programs for the following:
>(a)  To find the smallest number among the 3 numbers given.
>(b)  To check whether the given string is a palindrome or not.
>(c)  To sort the given list of numbers in descending order.
>(d)  To check, how many times a given substring occurs in a given main string.
>(e)  To find the factorial of a given number
>
>If any one have this do send it to me

How about you try doing your own homework for school instead of asking 
someone else to do it for you?

>Regards,
>Jogesh Kanojia,
>Sr. Software Engineer.

I don't know whether that's funny or sad.  Both, I suppose.

>Patni Computer Systems Limited
>Mobile:- +91 9820275701
>Tel:+91-22-27611090 Ext.4018

On the other hand, if you seriously need help solving these kinds of 
problems, I am available to do small projects and can provide a quote for 
services if you contact me off-list.  I expect there are multiple other 
folks on the list who could also provide such services for hire.

--
Jeff Woods <kazrak+kernel@cesmail.net> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help in Shell script
  2004-05-11  4:35 ` Help in Shell script Jogesh Kanojia
  2004-05-11  5:02   ` A C program to merge content of 2 binary tree, etc Jeff Woods
@ 2004-05-11  5:47   ` John T. Williams
  2004-05-11  6:15     ` Jim Boedicker
  2004-05-11 19:40   ` Jan-Benedict Glaw
  2 siblings, 1 reply; 6+ messages in thread
From: John T. Williams @ 2004-05-11  5:47 UTC (permalink / raw)
  To: Jogesh Kanojia; +Cc: Linux-C-Programming (E-mail)

It seems someone wants us not only to do his homework for him, but also
seems to think that a listserv on programming in c for linux is the
right place for questions on shell scripting and OOP.  I'd be willing to
bet that most of the people here probably know C++ as well as they know
C, but shell scripting?  There may be someone unethical enough to do
your homework for you, but I hope not.

Sincerely, 
John T. Williams
(Doing my own damn school work) 




On Tue, 2004-05-11 at 00:35, Jogesh Kanojia wrote:
> Hi
> 
> I want shell programs for the following:
> (a)  To find the smallest number among the 3 numbers given.
> (b)  To check whether the given string is a palindrome or not.
> (c)  To sort the given list of numbers in descending order.
> (d)  To check, how many times a given substring occurs in a given main
> string.
> (e)  To find the factorial of a given number
> 
> If any one have this do send it to me
> 
> Regards,
> Jogesh Kanojia,
> Sr. Software Engineer.
> Patni Computer Systems Limited
> Mobile:- +91 9820275701
> Tel:+91-22-27611090 Ext.4018
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help in Shell script
  2004-05-11  5:47   ` Help in Shell script John T. Williams
@ 2004-05-11  6:15     ` Jim Boedicker
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Boedicker @ 2004-05-11  6:15 UTC (permalink / raw)
  To: Linux-C-Programming (E-mail)

John T. Williams wrote:
> It seems someone wants us not only to do his homework for him, but also
> seems to think that a listserv on programming in c for linux is the
> right place for questions on shell scripting and OOP.  I'd be willing to
> bet that most of the people here probably know C++ as well as they know
> C, but shell scripting?  There may be someone unethical enough to do
> your homework for you, but I hope not.
> 
> Sincerely, 
> John T. Williams
> (Doing my own damn school work) 
> 
> On Tue, 2004-05-11 at 00:35, Jogesh Kanojia wrote:
> 
>>Hi
>>
>>I want shell programs for the following:
>>(a)  To find the smallest number among the 3 numbers given.
>>(b)  To check whether the given string is a palindrome or not.
>>(c)  To sort the given list of numbers in descending order.
>>(d)  To check, how many times a given substring occurs in a given main
>>string.
>>(e)  To find the factorial of a given number
>>
>>If any one have this do send it to me
>>
>>Regards,
>>Jogesh Kanojia,
>>Sr. Software Engineer.
>>
Ease up on him guys, he's a "Senior Software Engineer",
asking for help with shell scripts, what a Joke!
And, as John says above on a "C programming" list!

I'd be too damn embarrassed to call myself that, and ask
the community for help on the wrong list Yet!

Jim Boedicker
(Already Did My Homework!)
-- 
"Besides, I think Slackware sounds better than "Microsoft", don't you?
                     -Patrick Volkerding


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help in Shell script
  2004-05-11  4:35 ` Help in Shell script Jogesh Kanojia
  2004-05-11  5:02   ` A C program to merge content of 2 binary tree, etc Jeff Woods
  2004-05-11  5:47   ` Help in Shell script John T. Williams
@ 2004-05-11 19:40   ` Jan-Benedict Glaw
  2 siblings, 0 replies; 6+ messages in thread
From: Jan-Benedict Glaw @ 2004-05-11 19:40 UTC (permalink / raw)
  To: Linux-C-Programming (E-mail)

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On Tue, 2004-05-11 10:05:43 +0530, Jogesh Kanojia <jogesh.kanojia@patni.com>
wrote in message <000e01c43711$6c2a4de0$ae63d103@patni.com>:
> Hi
> 
> I want shell programs for the following:
> (a)  To find the smallest number among the 3 numbers given.

function get_smallest_3() {
	[ "$1" -lt "$2" -a "$1" -lt "$3" ] && echo "$1"
	[ "$2" -lt "$1" -a "$2" -lt "$3" ] && echo "$2"
	[ "$3" -lt "$1" -a "$3" -lt "$2" ] && echo "$2"
}

> (b)  To check whether the given string is a palindrome or not.

function is_palindrome() {
	if [ "$1" = "`echo "$1" | rev`" ]; then
		return 0
	else
		return 1
	fi
}

> (c)  To sort the given list of numbers in descending order.

function sort_numbers() {
	for nr in $*; do
		echo $nr
	done | sort --numeric-sort --reverse
}

> (d)  To check, how many times a given substring occurs in a given main
> string.

That seems to be a bit more complicated. Don't have an idea ad hoc...

> (e)  To find the factorial of a given number

function factorial() {
	echo -e "define fact(x) { if (x <= 1) return (1); return (fact(x-1) * x); }\nfact(4)" | bc
}


Of course, there are superb books on shell programming and yes, I don't
like preparing other people's homework:)

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-11 19:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-11  3:41 A C program to merge content of 2 binary tree Jogesh Kanojia
2004-05-11  4:35 ` Help in Shell script Jogesh Kanojia
2004-05-11  5:02   ` A C program to merge content of 2 binary tree, etc Jeff Woods
2004-05-11  5:47   ` Help in Shell script John T. Williams
2004-05-11  6:15     ` Jim Boedicker
2004-05-11 19:40   ` Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).