Problem Specifications
In this sessional you will implement insertion sort and binary search algorithm in assembly language programming. You will take n integers as inputs from a user, sort them and display the sorted array. Next you will take another integer as input from the user and search it in the sorted array using binary search algorithm and display its index in the sorted array if it exists (Assume that indices start from 1). In a nutshell, you have to implement the following algorithmic steps.
- Take an integer n from the user.
- Go to Step 10 if n <=0
- Take n integers from the user.
- Sort them using insertion sort.
- Display the sorted array.
- Take an integer x from the user.
- Use binary search to find x’s index in the sorted array. Display the index if found, otherwise print ‘NOT FOUND’.
- For another search in the same array go to Step 6.
- Go to Step 1.
- End
Note: You can assume any form of number to be in the range of signed 16 bit register.
Problem Specifications
Take a base value as input from the user. Then take an input N in the base value of given base. Convert the given number to binary and display.
Note: You can assume any form of number to be in the range of signed 16 bit register.
Problem Specifications
A faulty number is one for which the sum of its proper divisors is greater than the number itself. The proper divisors of a number are all the divisors except 1 and the number itself. For example, 12 is a faulty number because the sum of the proper divisors is 2 3 4 5=15 which is greater than 12. Write a program to take an integer number N as input and output the number of faulty numbers between 1 and N
Note: You can assume any form of number to be in the range of signed 16 bit register.
Problem Specifications
Take N integers as inputs from the user. Sort them in descending order using selection sort and display the sorted array for every step of the selection sort operation. Finally print the sorted array.
Note: You can assume any form of number to be in the range of signed 16 bit register.