In an array-based implementation of a complete binary tree, what is the index of the left child of a node at index i (assuming zero-based indexing)?
A
2i
B
2i + 1
C
i + 1
D
i - 1
উত্তরের বিবরণ
Answer: খ)
2*i + 1
The usual mapping (zero-based arrays)
When a binary tree is stored in an array arr[] with root at index 0, the index
formulas are:
Left child of node at index i → left = 2*i + 1
Right child of node at index i → right = 2*i + 2
Parent of node at index i (i > 0) → parent = floor((i - 1) / 2)
Example: arr = [A, B, C, D, E, F, G] (indices 0..6)
index: 0 1 2 3 4 5 6
value: A B C D E F G
Tree:
Check: left child of i=1 is 2*1+1=3 → D
(correct).
Right = 2*1+2=4 → E.
One-based indexing alternative
If the array is one-based (root at index 1), the formulas shift:
Left = 2*i++ 1
Right = 2*i + 2
Parent = floor(i / 2)

0
Updated: 2 days ago
For BFS of a graph, we should use:
Created: 2 days ago
A
queue
B
Stack
C
priority queue
D
stack.
BFS বা Breadth-First Search একটি গ্রাফ ট্রাভার্সাল পদ্ধতি যা **স্তরভিত্তিক (level-wise)**ভাবে নোডগুলো অনুসন্ধান করে। এজন্য এটি এমন একটি ডেটা স্ট্রাকচার ব্যবহার করে যা First-In-First-Out (FIFO) নীতিতে কাজ করে, অর্থাৎ Queue।
মূল ধারণা:
-
সূত্র নোড থেকে শুরু করে সেটিকে enqueue করা হয়।
-
একটি নোড dequeue করে তার অপরিদর্শিত প্রতিবেশী (unvisited neighbors) গুলোকে enqueue করা হয়।
-
এই প্রক্রিয়া চলতে থাকে যতক্ষণ না queue ফাঁকা হয়।
উদাহরণ:
যদি গ্রাফটি A নোড থেকে শুরু হয়, তাহলে Queue: A → B → C → D …
প্রতিবার সামনে থেকে remove (dequeue) করা হয় এবং নতুন প্রতিবেশী নোডগুলোকে পিছনে add (enqueue) করা হয়।
সংক্ষেপে সম্পর্ক:
BFS → Queue (FIFO) → Level order
DFS → Stack (LIFO) → Depth order

0
Updated: 2 days ago
Newton's backward interpolation formula is the most effective when:
Created: 2 days ago
A
Interpolation point is near the beginning
B
Interpolation point is near the end
C
Data points are not equally spaced
D
Function is non-polynomial
Newton’s Backward Interpolation Formula ব্যবহৃত হয় যখন interpolation point ডেটা টেবিলের শেষের দিকে থাকে। এটি এমন ক্ষেত্রে সবচেয়ে উপযোগী, যেখানে আমরা শেষের কিছু মানের কাছাকাছি কোনো অজানা মান অনুমান করতে চাই।
বিস্তারিতভাবে:
-
Newton’s Forward Interpolation Formula ব্যবহৃত হয় যখন interpolation point ডেটা টেবিলের শুরুতে থাকে।
-
Newton’s Backward Interpolation Formula প্রয়োগ করা হয় যখন interpolation point শেষের দিকে থাকে।
-
উভয় সূত্রেই ধরে নেওয়া হয় যে data points সমান দূরত্বে (equally spaced) অবস্থিত।
-
পার্থক্য কেবল ব্যবহৃত finite difference এর দিকনির্দেশে—
-
Forward interpolation → forward difference (Δ) ব্যবহার করে।
-
Backward interpolation → backward difference (∇) ব্যবহার করে।
-
-
ফলে backward interpolation শেষ দিকের মান অনুমান করার ক্ষেত্রে সবচেয়ে সঠিক ফল দেয়।
ভুল বিকল্পগুলো:
-
(ক) শুরুতে → Forward Interpolation এর জন্য ব্যবহৃত হয়।
-
(গ) অসমানভাবে দূরত্বযুক্ত ডেটা → এর জন্য Divided Difference Formula প্রযোজ্য।
-
(ঘ) Non-polynomial function → Interpolation সর্বদা polynomial দ্বারা আনুমানিক মান নির্ধারণ করে, তাই ফাংশনের প্রকৃতি সূত্রকে প্রভাবিত করে না।

0
Updated: 2 days ago
The bisection method is used to:
Created: 2 days ago
A
Find the eigenvalue of a matrix
B
Solve a system of linear equation
C
Find roots of non-linear equations
D
Perform numerical integration
Answer: গ)
Find roots of non-linear equations 0
Updated: 2 days ago
Explanation:
The Bisection Method is a numerical method used to find roots of of
non-linear equations for a real-valued function f(x)=0
How it works: