DATA STRUCTURE Programming and Technical Programming Technical

Which of the following data structure is better for storing the sorted data on which often insert and deletion operations are performed?

A. Linked list
B. Queue
C. Array
D. Doubly linked-list

Read Solution (Total 1)

DATA STRUCTURE Other Question

Problem Statement:

Problem statement is very easy . On a positive integer, you can perform any one of the following 3 steps.

1.) Subtract 1 from it. ( n = n - 1 )

2.) If its divisible by 2, divide by 2. ( if n % 2 == 0 , then n = n / 2 )

3.) If its divisible by 3, divide by 3. ( if n % 3 == 0 , then n = n / 3 )

Given a positive integer n and you task is find the minimum number of steps that takes n to one .