Company: Cashfree_6nov_MCQ
Difficulty: medium
Analyze the following code snippet, identify the problem and choose the best refactoring technique. function printOvertimeRate(hours, rate){ // Calculate total hours worked let sum = 0; for(let i = 0; i 40){ overtime = sum - 40 }else{ overtime = 0 } // Calculate the overtime rate let overtimeRate; if(overtime > 0) { ... } }
Given the equation a+b*c-d in infix notation, use the following algorithm to change it to postfix notation. Notes: Multiplication is a higher priority than addition and subtraction. The variables a, b, c, and d are operands. The remaining characters (+,-,*) are operators. Algorithm: Initialize an empty stack. Scan the string from left to right, building the postfix string T as you go. If the scann
An example of a O(1) task is...
Graph G has the following undirected edges: A - B, A - C, B - D, B - E, C - D, C - E. Which option is true about G?