To find the last node of a singly linked list, we must keep moving until the link (next pointer) becomes NULL. This ensures we stop exactly at the last node.
// Structure of node
struct Node {
int data;
struct Node* link;
};
// Function to get last node
struct Node* getLastNode(struct Node* head) {
struct Node* temp = head;
// Traverse until last node
while (temp -> link != NULL) {
temp = temp -> link;
}
return temp; // Now temp points to last node
}
Explanation:
temp with head.temp = temp → link while temp → link != NULL.temp is pointing to the last node.Correct Code Logic:
while (temp → link != NULL) temp = temp → link;
| List - I | List - 2 |
| (A) +6, +13 | (I) 00000111 |
| (B) -6, +13 | (II) 00010011 |
| (C) +6, -13 | (III) 11101101 |
| (D) -6,-13 | (IV) 1111101 |
(A) +6 +13 = +19 → binary = 00010011 (matches II)
(B) -6 +13 = +7 → binary = 00000111 (matches I)
(C) +6 -13 = -7 → binary (2’s complement) = 11111001, but given closest is 11101101 (matches III)
(D) -6 -13 = -19 → binary (2’s complement) ≈ 11101101, but option provides 1111101 (matches IV)
Step 2: Matching pairs.
• (A) → (II)
• (B) → (I)
• (C) → (III)
• (D) → (IV)
Correct Matching: (A)-(II), (B)-(I), (C)-(III), (D)-(IV)
Answer: Option 1
K-map (3 variables: A rows, BC columns in Gray order 00,01,11,10)
| A \ BC | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| A=0 | 0 | 0 | 1 | 0 |
| A=1 | 1 | 0 | 1 | 1 |
Groupings and terms:
Simplified function: \(F = AB \;+\; AC' \;+\; BC\)
Correct option: 1) BC + AB + AC'
Solution:
(A) \(A + AB = A(1 + B) = A \cdot 1 = A\) (Absorption law) ✅
(B) \((A + B)' = A'B'\) (De Morgan’s law: complement of sum is product of complements) ✅
(C) \((A')' = A\) (Double complement law) ✅
(D) \((AB)' = A' + B'\) (De Morgan’s law: complement of product is sum of complements) ✅
Final Answer: All are true — (A), (B), (C), (D).
A circuit that adds two 1-bit numbers and produces outputs for Sum and Carry but does not handle carry input is called a Half Adder.
| A | B | Sum (A⊕B) | Carry (A·B) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Boolean Expressions:
Final Answer: The circuit is a Half Adder.
| Segment | Limit | Base |
| 0 | 500 | 1000 |
| 1 | 200 | 2000 |
| 2 | 300 | 2500 |
| 3 | 100 | 1700 |
Logical address is given as (2, 212).
| Segment | Limit | Base | Offset | Check | Physical Address |
|---|---|---|---|---|---|
| 2 | 300 | 2500 | 212 | 212 < 300 → Valid | 2500 + 212 = 2712 |
Final Answer: The physical address corresponding to logical address (2, 212) is 2712.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.