In: Computer Science
Python
What are the advantages and disadvantages of solving a problem that can be broken down into repetitive tasks with recursion as opposed to a loop? Explain your answer.
Sometimes Graphical User Interfaces can be too cluttered. What is a good general rule of thumb for the number of elements on a page within a Graphical User Interface? Explain your answer.
Recursion:
The recursive function calls to itself and a terminate or base condition is specified which breaks the infinite execution of the recursive call. When the function call to itself then it works like a continue statement and the control goes to the starting of the function with updated argument value.
The stack data structure is used in recursion for storing the intermediate value when each function call is made.
In a recursive function, two cases are mentioned:
Base condition:
A terminate condition or base condition is specified which breaks the infinite execution of the recursive call.
Recursive Call:
The function will call to itself and this is known as a recursive call.
Advantages:
Disadvantages:
Iterative or loop:
The iterative statement like for() loop, while() loop, do-while() loop, etc uses the iterative statement and allows the set of instructions to be repeatedly executed. These statement includes initialization, condition, and update the control variable and repeatedly executed until a certain condition is reached.
Difference between iterative and recursive program:
When we should use recursion?
Recursion is more efficient than a regular loop when we solve a problem that can be broken down into smaller repetitive problems. When the iterative solution is too complex and has many possible branches then the recursion method is more efficient.
When we should use iterative method?
The stack data structure is used in recursion for storing the intermediate value when each function call is made. If the stack space is large enough then memory overflow may occur. If memory overflow is the major issue then we should use the iterative method.
OR
Graphical user interface is a subset of user interface which includes graphical elements such as windows,icons and buttons.Graphical user interface are exclusively controlled by mouse and keyboard.GUI allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.
Advantages and disadvantages of GUI opposed to the command line:
>CLI stands for command line interface which is most difficult to use when compared to GUI.In CLI we use command prompt to enter our input where as in GUI we use input can be entered anywhere on the screen.
>CLI is text based interface which is used to interact with software and operating systems by typing commands from the command prompt.Examples :There are two main operating systems use CLI are DOS for windows and bash shell for linux and os.
>The users of GUI are provided with immediate visual feedback in many cases whereas in CLI there is no obvious feedback .So, most of the people prefer GUI which is easy to use than CLI.
>CLI can perform some tasks which are difficult and cannot be performed by GUI.In terms of functionality CLI is preferred most than GUI.
>GUI is used in some cases where we can have minimum stress and to reduce mental work as it can simplfy tasks and makes results visible.
>CLI can be used for some cases where tasks are needed to be scriped and automated.To use this we need to have greater control over system functions.CLI utilizes less memory version.
>GUI has the higher ability to perform multiple tasks at the same time very easily where as CLI cannot perform with the same ease.GUI cannot have same level of functionality and granual control over systems as CLI.
>Precision is high in CLI and low in GUI.Custom changes can be employed in GUI where appearance cannot be changed in CLI.
>There are over 270 commands available for functions such as open,delete..These commands must be used correctly without mistakes.
>The disadvantages of GUI include :it is harder to implement and requires lot of memory,more hardware and software requirements are needed.
>GUI can be handled by a biggener where as CLI user must have some knowledge over commands and how to make use of it.
Sometimes graphical user interface can be too cluttered because of the layout designed.The designers might understand and have clear knowledge about their design but the other people cannot understand it.In that case a designer should think with others percpectives and make a good design which is easy to understand.
>The journey of the customers must be carefully navigated and focus on a single goal in order to meet the needs of a customer.
>For productive page, the designer must use spaces and highlighten the words which are important ,gaps between discriptions.The designer should not use more than three colours in a single layout.
>HAving too much text can also make some GUI clutter.It might overwhelm your customers and distract them from taking the right action.
Good general rule of thumb for the number of elements on a page with graphical user interface:
>Rule of thumb is a general procedure based on experience or praactice.
>The general rule for designing a good GUI is:Match between the sytem and real world,i.e. the deisgner should design a layout whiuch is celan and clear where people can understand and make better use of it.For this, the designer must follow certain principles like Paying attention to the context and contrast,avoiding more whitespaces,never highlighten the background.
>Error prevention is also a major good rule of thumb.
i hope it helps..
If you have any doubts please comment and please don't dislike.
PLEASE GIVE ME A LIKE. ITS VERY IMPORTANT FOR ME