# MCQ | Line Filling Algorithms in Computer Graphics

**Multiple choice questions and answers (MCQ) based on the Line Filling Algorithms in Computer Graphics** with 4 choices, correct answer and explanation.

Submitted by Monika Sharma, on June 12, 2020

**Question 1: Which of the following methods is the fastest pixel position calculating method?**

- Bressenham's line algorithm
- DDA line algorithm
- Mid-point algorithm
- None of the above

**Answer: d. DDA line algorithm**

**Explanation:**

The DDA is the fastest algorithm among the given algorithms for calculating the position of the pixels because it has a very easy formula or way to calculate which can be readily implemented and executed in programs.

**Question 2: Which of the following line algorithms best balances the processing load among all the processers?**

- Parallel line algorithm
- DDA line algorithm
- Both a. and b. balances the load equally
- None of the above

**Answer: a. Parallel line algorithm**

**Explanation:**

If a parallel line algorithm has 'n' processes then this algorithm divides it into a number of partitions and generates line segments. Thus the load on the processors gets divided.

** Question 3: Consider the following statement:**

*"The boundary is specified in a single color, and the algorithm proceeds pixel by pixel until the boundary color is encountered."*

**The above statement defines which of the following algorithms?**

- Scan-line fill algorithm
- Boundary-fill algorithm
- Entire fill algorithm
- Slide curve algorithm

**Answer: b) Boundary-fill algorithm**

**Explanation:**

Mainly, this algorithm proceeds outward pixel by pixel until the boundary color is encountered. Hence, the given statement definition correctly defines the Boundary fill algorithm.

**Question 4: In Bressenham’s line algorithm, there are certain conditions for deciding the successive parameters. Of the distances d1 < d2 then decision parameter Pk is which of the following?**

- Positive
- Equal
- Negative
- Can be any of the above

**Answer: c. Negative**

**Explanation:**

If d1 < d2 then the decision variable is always negative.ie. Pk is always negative.

**Question 5: The term "DDA" in the DDA algorithm stands for:**

- Digital difference analyzer
- Direct differential analyzer
- Digital differential analyzer
- Data differential analyzer

**Answer: c. Digital differential analyzer**

**Explanation:**

DDA stands for Digital differential analyzer which is use to draw a line.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.