if you want to remove an article from website contact us from top.

    which of the following is not an advantage of fibonacci search

    Mohammed

    Guys, does anyone know the answer?

    get which of the following is not an advantage of fibonacci search from screen.

    Q: Which of the following is not an advantage of Fibonacci Search?

    Question: Which of the following is not an advantage of Fibonacci Search?

    Options

    A : When the element being searched for has a non uniform access storage

    B : Can be used in magnetic tapes

    C : Can be used for large arrays which do not fit in the CPU cache or in the RAM

    D : It can be applied efficiently on unsorted arrays

    Click to view Correct Answer

    Previous ||

    Data Structure Fibonacci Search more questions

    Under what condition the number of inversions in an array....

    Metabolic control analysis does not suggest that ___________

    Reinforced brick work is used in which of the following....

    Reinforced brickwork is used in which of the following circumstances?

    When is the shape of the negative half of the....

    Which of the following correctly defines a peptic ulcer?

    How can you understand that a patient has a Barrett’s....

    When is the LES filter commutative?

    In which of the following cases the first base of....

    In which of the following cases the first base of....

    Data Structure Adjacency List more Online Exam Quiz

    Data Structure Evaluation Infix Expression Not Parenthesized

    Data Structure Experienced

    Data Structure Factorial Recursion

    Data Structure Fibonacci Dynamic Programming

    Data Structure Fibonacci Recursion

    Data Structure Free List

    Data Structure Freshers

    Data Structure Generating Combinations

    Data Structure Generating Partitions

    Data Structure Generating Subsets

    स्रोत : amon.in

    250+ TOP MCQs on Fibonacci Search and Answers 2022

    Data Structure Multiple Choice Questions on “Fibonacci Search”. 1. Which algorithmic technique does Fibonacci search use?a) Brute forceb) Divide and

    Home » Data Structures & Algorithms Objective Questions » 250+ TOP MCQs on Fibonacci Search and Answers

    250+ TOP MCQs on Fibonacci Search and Answers

    Data Structure Multiple Choice Questions on “Fibonacci Search”.

    1. Which algorithmic technique does Fibonacci search use?

    a) Brute force

    b) Divide and Conquer

    c) Greedy Technique d) Backtracking Answer: b

    Clarification: With every iteration, we divide the given array into two sub arrays(not necessarily equal).

    2. Choose the recursive formula for the Fibonacci series.(n>=1)

    a) F(n) = F(n+1) + F(n+2)

    b) F(n) = F(n) + F(n+1)

    c) F(n) = F(n-1) + F(n-2)

    d) F(n) = F(n-1) – F(n-2)

    Answer: c

    Clarification: None.

    3. Write a function for the Fibonacci search method.

    a)

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) high = mid - 1;

    else if (key > a[mid]) low = mid + 1;

    else return mid; } return -1; } b)

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) high = mid - 1;

    else if (key > a[mid]) low = mid + 1;

    else return mid; } return -1; } c)

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) low = mid + 1;

    else if (key > a[mid]) high = mid - 1;

    else return mid; } } d)

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) low = mid - 1;

    else if (key > a[mid]) high = mid - 1;

    else return mid; } } Answer: a

    Clarification: Here instead of choosing middle of the array as a point of array division, we use Fibonacci numbers, the division index are strictly between two Fibonacci numbers.

    4. What is the time complexity of Fibonacci Search?

    a) O(logn) b) O(n) c) O(n2) d) O(nlogn) Answer: a

    Clarification: Since it divides the array into two parts, although not equal, its time complexity is O(logn), it is better than binary search in case of large arrays.

    5. Which of the following is not an advantage of Fibonacci Search?

    a) When the element being searched for has a non uniform access storage

    b) Can be used in magnetic tapes

    c) Can be used for large arrays which do not fit in the CPU cache or in the RAM

    d) It can be applied efficiently on unsorted arrays

    Answer: d

    Clarification: When the speed of access depends on the location previously accessed, Fibonacci search is better compared to binary search as it performs well on those locations which have lower dispersion. Fibonacci search won’t work on unsorted arrays. The input should be a sorted array or array should be sorted before Fibonacci search.

    6. What is the length of the step in jump search?

    a) n b) n/2 c) sqrt(n) d) 1 Answer: c

    Clarification: If the step size is 1, it becomes a linear search, if it is n, we reach the end of the list in just on step, if it is n/2, it becomes similar to binary search, therefore the most efficient step size is found to be sqrt(n).

    7. Select the code snippet for Jump Search.

    a)

    public int jumpSearch(int arr[], int key)

    {

    int size = arr.length;

    int step = floor(sqrt(size));

    int prev = 0;

    while (arr[(step > size ? step : size)] < key)

    { prev = step;

    step += floor(sqrt(size));

    if (step >= size) { return -1; } }

    while (arr[prev] < key)

    { prev++;

    if (prev == (step < size ? step : size))

    { return -1; } }

    if (arr[prev] == key)

    { return prev; } return -1; } b)

    public int jumpSearch(int arr[], int key)

    {

    int size = arr.length;

    स्रोत : engineeringinterviewquestions.com

    Fibonacci Search Questions and Answers

    This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on “Fibonacci Search”. 1. Which algorithmic technique does Fibonacci search use? a) Brute force b) Divide and Conquer c) Greedy Technique d) Backtracking 2. Choose the recursive formula for the Fibonacci series.(n>=1) a) F(n) = F(n+1) + F(n+2) b) F(n) = F(n) + ... Read more

    Data Structure Questions and Answers – Fibonacci Search

    « Prev Next »

    This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on “Fibonacci Search”.

    1. Which algorithmic technique does Fibonacci search use?

    a) Brute force

    b) Divide and Conquer

    c) Greedy Technique d) Backtracking View Answer

    2. Choose the recursive formula for the Fibonacci series.(n>=1)

    a) F(n) = F(n+1) + F(n+2)

    b) F(n) = F(n) + F(n+1)

    c) F(n) = F(n-1) + F(n-2)

    d) F(n) = F(n-1) – F(n-2)

    View Answer

    3. Write a function for the Fibonacci search method.

    a)

    Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

    advertisement

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) high = mid - 1;

    else if (key > a[mid]) low = mid + 1;

    else return mid; } return -1; } b)

    Check this: Programming MCQs | Computer Science Books

    Learn more

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) high = mid - 1;

    else if (key > a[mid]) low = mid + 1;

    else return mid; } return -1; } c) advertisement

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) low = mid + 1;

    else if (key > a[mid]) high = mid - 1;

    else return mid; } } d) advertisement

    public static int fibSearch(final int key, final int[] a)

    { int low = 0;

    int high = a.length - 1;

    int fibCurrent = 1; int fibPrev = 1; int N = a.length; while (low <= high) {

    while(fibCurrent < N)

    {

    int tmp = fibCurrent + fibPrev;

    fibPrev = fibCurrent;

    fibCurrent = tmp;

    N = N - (fibCurrent - fibPrev);

    }

    final int mid = low + (high - low) - (fibCurrent + fibPrev);

    if (key < a[mid]) low = mid - 1;

    else if (key > a[mid]) high = mid - 1;

    else return mid; } } View Answer

    4. What is the time complexity of Fibonacci Search?

    a) O(logn) b) O(n) c) O(n2) d) O(nlogn) View Answer

    5. Which of the following is not an advantage of Fibonacci Search?

    a) When the element being searched for has a non uniform access storage

    b) Can be used in magnetic tapes

    c) Can be used for large arrays which do not fit in the CPU cache or in the RAM

    d) It can be applied efficiently on unsorted arrays

    View Answer

    6. What is the length of the step in jump search?

    a) n b) n/2 c) sqrt(n) d) 1 View Answer

    7. Select the code snippet for Jump Search.

    a)

    public int jumpSearch(int arr[], int key)

    {

    int size = arr.length;

    int step = floor(sqrt(size));

    int prev = 0;

    while (arr[(step > size ? step : size)] < key)

    { prev = step;

    step += floor(sqrt(size));

    if (step >= size) { return -1; } }

    while (arr[prev] < key)

    { prev++;

    if (prev == (step < size ? step : size))

    { return -1; } }

    if (arr[prev] == key)

    { return prev; } return -1; } b)

    public int jumpSearch(int arr[], int key)

    {

    int size = arr.length;

    int step = floor(sqrt(size));

    int prev = 0;

    while (arr[(step < size ? step : size)] < key)

    { prev = step;

    step += floor(sqrt(size));

    if (step >= size) { return -1; } }

    while (arr[prev] < key)

    { prev++;

    if (prev == (step < size ? step : size))

    { return -1; } }

    if (arr[prev] == key)

    { return prev; } return -1; } c)

    public int jumpSearch(int arr[], int key)

    {

    int size = arr.length;

    int step = floor(sqrt(size));

    int prev = 0;

    while (arr[(step > size ? step : size)] < key)

    { prev = step;

    step += floor(sqrt(size));

    if (step >= size) { return -1; } }

    while (arr[prev] > key)

    { prev++;

    if (prev == (step < size ? step : size))

    स्रोत : www.sanfoundry.com

    Do you want to see answer or more ?
    Mohammed 8 day ago
    4

    Guys, does anyone know the answer?

    Click For Answer