NSCT PAST PAPERS AND SYLLABUS
فری تیاری کیلے وٹس ایپ
گروپ جوائن کریں
Click here
چار آپشن میں سے کسی ایک پر کلک کرنے سے جواب سرخ ہو جائے گا۔
- By length only
- By character ASCII values in order
- Randomly
- By reversing strings
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
In C++, strings are compared lexicographically using the <, >, == operators.
Comparison proceeds character by character from left to right.
Each character is evaluated using its ASCII (or Unicode) value.
- They are irrelevant for large input sizes
- They are always zero
- They depend on memory
- They improve performance
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Big-O notation measures the growth rate of an algorithm as input size increases.
Constants do not affect growth rate for large inputs, so they are ignored.
For example, O(3n) is simplified to O(n) in Big-O terms.
This helps focus on scalability rather than exact runtime.
- Mobile devices are slower
- Ensures optimal display on small screens before scaling up
- Desktop always loads first
- Reduces CSS file size
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
- Mobile-first design starts with styles for small screens and adds enhancements for larger screens.
- This approach ensures the website is usable on mobile devices, which have limited space.
- Media queries are then used to scale layouts for tablets and desktops.
- z-index
- position
- display
- float
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
z-index controls the stacking order of overlapping elements in CSS.
Elements with a higher z-index appear in front of elements with a lower z-index.
It only works on elements with a position value other than static (e.g., relative, absolute, fixed).
position sets how an element is positioned on the page but doesn’t control layering.
display and float affect layout and flow, not stacking order
- Border-radius
- Border-style
- Border-width
- Border-color
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
The border-radius property in CSS creates rounded corners on elements.
You can specify a single value for uniform rounding or multiple values for different corners.
border-style defines the line style (solid, dashed, etc.).
border-width sets the thickness of the border.
border-color sets the color of the border.
- Can have both red or black root node
- Has red root node
- Has black root node
- Root color does not matter
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
A Red-Black Tree is a self-balancing binary search tree.
One of its properties is that the root node is always black.
Other properties include:
-
Red nodes cannot have red children (no two reds in a row).
-
Every path from a node to its leaves has the same number of black nodes.
- Reduces CPU usage by checking only one device
- Ensures system always reads maximum available data efficiently
- Avoids memory leaks
- Minimizes network traffic
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
Max polling is commonly used in I/O operations and real-time systems.
It is a technique where the system reads all available data from a device or buffer in one go.
It reduces the number of polling cycles needed, improving efficiency.
- Match between system and real world
- User control and freedom
- Consistency and standards
- Aesthetic and minimalist design
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
User control and freedom allows users to undo or redo actions.
It helps users recover from mistakes without severe consequences.
- Easier to implement
- Violates interface segregation principle
- Improves performance
- No effect
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
The Interface Segregation Principle (ISP) states that clients should not be forced to depend on methods they do not use.
If an interface has too many unrelated methods, it becomes difficult to implement and maintain.
Clients may be forced to implement methods that are irrelevant to them.
- Ignores negative edges
- Finds shortest paths even with negative edges
- Converts negative edges to zero
- Throws an error
اس سوال کو وضاحت کے ساتھ پڑھیں
Explanation
The Floyd–Warshall algorithm computes shortest paths between all pairs of vertices.
It supports negative edge weights, as long as there are no negative cycles.
Negative cycles make the shortest path undefined, which Floyd–Warshall can detect.