CoolInterview.com - World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS ALGORITHM DETAILS
    Question :
    Please Give the example of bruteforce algorithm?

    Posted by: nageswara on 4/10/2010

    Contact nageswara Contact nageswara
    Category Algorithm Interview Questions
    Rating (0.3) By 1769 users
    Added on 4/10/2010
    Views 1535
    Rate it!
    Answers:

    Selection sort can be one of the examples of brute force algorithm...
    Algorithm Selectionsort(a[0...n-1])
    for i<-0 to n-2 do
    min <- i
    for j <- i+1 to n-1 do
    if A[j]< A[min] min <-j
    swap A[i] and A[min]



    Posted by: Radhika B.    

    Contact Radhika B. Contact Radhika B.

    Progam to check if a given number is a prime number is a brute force algorithm.

    while(p <= n)
    {
    c=0;
    for(i=2; i<=p/2; i++)
    { if(p % i==0) c++; }
    if(c == 1) printf("%d ", p);
    p++;
    }





    Posted by: K Neeraj Lal    

    Contact K Neeraj Lal Contact K Neeraj Lal

    Every Searching algorithm whether it is Linear Search,Binary Search, Linear Recursive search,etc are brute force algorithms..

    to design a brute force algorithm for password breaking.you need to see what are the possible characters allowed
    take arrays of different combination like arr1 comprising of special characters,arr2 of numbers 0-9,arr3 of alphabets(both upper and lower)
    take arr1,keep a pointer pointing to 1st element and check all possible combination using two loops using all elements of arr1 & arr2

    then fix arr2 and check all possible combination using now arr1 and arr3

    Repeat same for arr3

    For better time complexity you can use binary search instead of linear search

    ALL THE BEST..



    Posted by: Praveen Nishchal    

    Contact Praveen Nishchal Contact Praveen Nishchal

    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    State the problems which differentiate between recursive procedure and non-recursive procedure?
    View Answer
    Explain the depth of recursion?
    View Answer
    Explain about procedural body and computation boxes?
    View Answer
    How can an inductive definition be realized?
    View Answer
    State recursion and its different types?
    View Answer
    Define and describe an iterative process with general steps of flow chart?
    View Answer
    Given a system of N equations whose coefficient matrix A is triangular and is stored in a vector R and the right hand side vector B, this algorithm obtains the solution vector X. Sum is a temporary variable. I am M are integer variables. How to follow the algorithm?
    View Answer
    In Algorithmic context how would you define ?book keeping operations??
    View Answer
    Explain the function SUB in algorithmic notation?
    View Answer
    What are the arguments present in pattern matching algorithms?
    View Answer
    Define string in an algorithmic notation and an example to support it?
    View Answer
    What are the two ways through which the Markov algorithm terminates?
    View Answer
    What is the general strategy for Markov Algorithm?
    View Answer
    The most basic tool used to express generating functions in closed form is the closed form expression for the geometric series, which is an expression of the form a+ar+ar2+-------+arn. It can either be terminated or extended indefinitely. What are the restrictions for this geometric series?
    View Answer
    Name any three skills which are very important in order to work with generating functions.
    View Answer
    Explain about the algorithm ORD_WORDS?
    View Answer
    Explain the function of KWIC_Create?
    View Answer
    What is the general algorithm model for any recursive procedure?
    View Answer
    Give the difference of format between an algorithm and a sub algorithm?
    View Answer
    Define and state the importance of sub algorithm in computation and its relation ship with main algorithm?
    View Answer


    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Algorithm Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2014 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0.03125 Seconds