Jump to content


Photo

Simple C program


  • Please log in to reply
4 replies to this topic

#1 venumadhava

venumadhava

    the 0ne

  • Members
  • 1 posts
  • Country:
  • Gender:Male

Posted 08 March 2014 - 12:29 AM

hey guys i have tried to write a program on jumbled words in C

    i.e.

 -----> If we give a word it should display all the scrambled words of entered word

 

 

 

            E.g. IF GIVEN WORD :  car

                      THEN IT SHOULD SHOW ALL THE SCRAMBLE WORDS OF IT

                                     car

                                     cra

                                     acr

                                     arc

                                     rac

                                     rca 

             HOPE you all understood 

      and i hope someone can do this?!!!!



#2 heisenbug

heisenbug

    Gibson Hacker

  • Members
  • 79 posts
  • Country:
  • Gender:Male

Posted 10 March 2014 - 01:20 PM

That's just a simple permutation. Here's how I would do it in perl... 

 

Spoiler

Edited by heisenbug, 10 March 2014 - 01:21 PM.


#3 tekio

tekio

    5(R1P7 |<1DD13

  • Binrev Financier
  • 1,082 posts
  • Gender:Male
  • Location:The Blue Nowhere

Posted 13 March 2014 - 09:18 PM

There are a few ways to that. Some good, some really slow. 

 

As simple as your question seems, a lot of theory and thought is put into creating efficient brute-force / exhaustive search algorithms.

 

You could probably google stack overflow with the "site:" operator and find a good solution. Or you could study how exhaustive search algorithms work and are designed.

 

Just my two cents on it....



#4 smpl

smpl

    DDP Fan club member

  • Members
  • 45 posts
  • Country:
  • Gender:Male

Posted 16 March 2014 - 10:34 PM

Exactly what you need:

http://www.geeksforg...a-given-string/



#5 tekio

tekio

    5(R1P7 |<1DD13

  • Binrev Financier
  • 1,082 posts
  • Gender:Male
  • Location:The Blue Nowhere

Posted 17 March 2014 - 09:48 PM

^ Cool site! :)






BinRev is hosted by the great people at Lunarpages!