BPSC COMPUTER 25 YEARS PAST PAPERS
BPSC 5
years Past Papers Click
here
چار آپشن میں سے کسی ایک پر کلک کرنے سے جواب سرخ ہو جائے گا۔
- Do while
- For
- While
- All of them
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
for loops are ideal for iterating over rows and columns in 2D arrays with known sizes.
Nested for loops provide clear structure and indexing for accessing array elements.
جب تکرار کی تعداد پہلے سے معلوم نہیں ہوتی ہے کہ کون سا لوپ سب سے زیادہ موزوں ہے؟
- Do while
- For
- While
- All of them
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
while loop is ideal when iterations depend on a condition rather than a fixed count.
It continues looping until the condition becomes false, making it flexible for unknown iterations.
کون سا برانچنگ بیان آسانی سے گھونسلے کے پیچیدہ فیصلوں کو سنبھال سکتا ہے؟
- Switch
- If else
- Else if
- All of them
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
switch handles multiple discrete values of a variable more clearly than nested if-else statements.
It improves readability and structure in complicated decision-making scenarios.
مندرجہ ذیل میں سے کون سی سی میں معیاری بلٹین ڈیٹا ٹائپ نہیں ہے؟
- Bool
- Long
- Int
- Char
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Standard C (before C99) does not have a built-in bool type; _Bool was introduced in C99.
int, long, and char are standard primitive data types in C.
جدید کمپیوٹرز میں دستخط شدہ عدد کی نمائندگی کرنے کے لئے مندرجہ ذیل میں سے کون سا استعمال شدہ طریقہ ہے؟
- Excess 127
- 1's complement
- 2's complement
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
2's complement allows easy addition and subtraction of signed integers without extra logic.
It eliminates the problem of having two zeros, unlike sign-magnitude or 1's complement.
- Range
- Size
- Both A and B
- None of them
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
unsigned int cannot store negative numbers, so its range shifts from -2³¹ to 2³¹-1 to 0 to 2³²-1.
The memory size remains the same (4 bytes).
بائنری ڈھیر میں عنصر ڈالنے کی وقت کی پیچیدگی کیا ہے؟
- O(n log n)
- O(1)
- O(log n)
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Insertion in a binary heap requires adding the element at the end and then heapifying up to maintain heap property.
The heapify operation takes logarithmic time relative to the number of elements.
گراف میں مختصر ترین راستہ تلاش کرنے کے لیے کون سا الگورتھم استعمال ہوتا ہے؟
- Decision Tree
- Dijkstra's Algorithm
- K-Nearest Neighbors
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Dijkstra's Algorithm is used to find the shortest path between nodes in a graph, especially for weighted graphs.It works by iteratively selecting the closest unvisited node and updating the shortest path estimates.
اوسط معاملے میں کون سا چھنٹائی الگورتھم سب سے تیز ہے؟
- Quick Sort
- Merge Sort
- Bubble Sort
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Quick Sort has an average-case time complexity of O(n log n), making it faster than simple sorts like Bubble or Insertion.
It works efficiently with large datasets due to its divide-and-conquer strategy.
مندرجہ ذیل میں سے کون سا ڈیٹا ڈھانچہ ڈپلیکیٹ عناصر کی اجازت نہیں دیتا ہے؟
- Linked List
- Stack
- Hash Set
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Hash Set is a collection that stores unique elements only, automatically ignoring duplicates.
It provides fast lookup and ensures data uniqueness.
It is commonly used in databases and programming applications.