CUET 2026 May 24 Shift 1 Computer Science/ Information Practices Question Paper is available for download here. NTA conducted the CUET UG 2026 exam from 11th May to 31st May.
- CUET 2026 Computer Science exam consists of 50 questions for 250 marks to be attempted in 60 minutes.
- As per the marking scheme, 5 marks are awarded for each correct answer, and 1 mark is deducted for incorrect answer.
Candidates can download CUET 2026 May 24 Shift 1 Computer Science Question Paper with Answer Key and Solution PDF from links provided below.
CUET 2026 Computer Science May 24 Shift 1 Question Paper with Solution PDF
| CUET May 24 Shift 1 Computer Science Question Paper 2026 | Download PDF | Check Solutions |
helps to enforce integrity and identify relationships among tables in a database.
View Solution
Concept:
In relational database management systems (RDBMS), maintaining data accuracy, consistency, and establishing meaningful relationships across disparate tables is vital for structural integrity.
Database constraints and relationships are governed primarily by the implementation of keys, which serve as foundational attributes or sets of attributes.
Step 1: Understanding Database Keys and Integrity:
A key in a database relation is an attribute or a combination of attributes that uniquely identifies a record (or tuple) within a table.
Primary keys enforce entity integrity by guaranteeing that each record remains distinct and that no primary key attribute contains a null value.
Foreign keys enforce referential integrity by linking an attribute in a referencing child table to the primary key of a referenced parent table.
This mechanism establishes valid logical relationships between tables, ensuring that references cannot point to non-existent data.
Step 2: Analysis of Incorrect Options:
A row or tuple represents an individual record of data containing specific values for each attribute.
Rows or tuples do not define rules, relationships, or structural integrity constraints between tables.
A column represents a single vertical attribute or field across all tuples and merely stores data of a uniform type.
Neither rows nor columns by themselves enforce relational dependencies or constraints without an associated key specification.
Final Answer:
Therefore, a Key is specifically used to enforce integrity and identify relationships between tables.
Always identify the operational purpose of keys when linking tables in relational databases.
Which of the following can uniquely identify the tuples of a relation in a database?
(A) Foreign Key
(B) Primary Key
(C) Candidate Key
(D) Composite Primary Key
Choose the correct answer from the options given below:
View Solution
Concept:
Relational database relations are based on set theory, requiring that each tuple within a relation must be unique.
To distinguish each tuple uniquely from all others, certain attributes or attribute sets are designated as candidate, primary, or composite keys.
Step 1: Evaluation of Candidate and Primary Keys:
A Candidate Key is a minimal set of attributes that can uniquely identify any tuple in a relation without redundancy.
A Primary Key is chosen by the database designer from among the candidate keys to serve as the official unique identifier for each record.
A Composite Primary Key is a primary key that consists of two or more attributes combined together to achieve unique tuple identification.
Hence, (B), (C), and (D) all inherently possess the unique identification property.
Step 2: Evaluation of Foreign Key:
A Foreign Key is an attribute or collection of attributes in one relation that refers to the primary key of another relation.
A foreign key is allowed to contain duplicate values (for example, multiple employees having the same department ID) and null values unless restricted.
Consequently, a foreign key does not guarantee unique identification of tuples within its own host relation.
Final Answer:
The keys that can uniquely identify the tuples are Primary Key, Candidate Key, and Composite Primary Key, which corresponds to (B), (C), and (D) only.
Only Super, Candidate, and Primary (simple or composite) keys guarantee uniqueness of tuples within their own table.
Rama stores the data in a specific format or structure in a file. If the structure or format itself is changed, all the existing application programs accessing that file also need to be changed. Otherwise, the programs may not work correctly. What is this concept called?
View Solution
Concept:
In traditional file processing systems, file formats and physical data storage schemes are deeply embedded within application programs.
A major limitation of the file-based approach is the tight coupling between data representation and the programs manipulating that data.
Step 1: Understanding Data Dependency:
Data Dependency refers to the condition where changes in the physical storage structure, file format, or access mechanism mandate corresponding revisions to every application program interacting with that file.
In Rama’s case, whenever the file’s schema or format is altered, the programs fail unless modified.
Modern Database Management Systems solve this issue by implementing Data Independence, separating conceptual views from physical storage.
Step 2: Analysis of Alternative Options:
Data Sharing is the ability of different users and programs to access common data simultaneously.
Data Inconsistency describes a discrepancy where multiple redundant copies of the same data hold differing values due to improper updating.
Data Isolation means data is scattered across multiple different files in diverse formats, making writing new retrieval programs cumbersome.
Final Answer:
The phenomenon wherein application programs must be rewritten when data structure changes is defined as Data Dependency.
DBMS provides Data Independence (both logical and physical) to eliminate this traditional file-system drawback.
is known as design of database.
View Solution
Concept:
In database terminology, a clear distinction is drawn between the overall structural design of the database and the actual data values stored within it at any given moment.
Step 1: Defining Database Schema:
The overall design, structural description, and skeleton of a database is called the Database Schema.
A database schema defines the tables, attribute names, data types, relationships, and integrity rules that govern how data is organized.
The schema remains relatively static throughout the life cycle of the database system.
In contrast, the actual data populated inside the schema at a particular instant in time is referred to as a Database Instance.
Step 2: Evaluating Other Terms:
Constraints are logical assertions, restrictions, or business rules applied on attributes or relations to ensure data integrity.
Keys are specific fields designated to uniquely identify records and establish relations between tables.
Tuples represent individual rows containing actual data instances inserted into the relational tables.
Final Answer:
The structural design and definition of a database is universally termed the Schema.
Instance = Actual data snapshot at any given instant (changes constantly).
Consider the table ’STUDENT’:
From the above table ’STUDENT’, which query will return all the students from class ’XI’?
View Solution
Concept:
SQL data retrieval uses the SELECT statement combined with the WHERE clause to filter tuples that satisfy a given conditional predicate.
The asterisk symbol (*) denotes that all columns of the matching tuples must be projected in the result set.
Step 1: Analysis of the Requirement:
The task is to retrieve all information (all columns) for students studying in class ’XI’.
To specify equality with a string literal in standard SQL, the equality comparison operator (=) is employed along with single quotes surrounding the string.
Hence, the correct syntax is:
SELECT * FROM STUDENT WHERE Class = ’XI’;
Step 2: Error Analysis in Other Options:
Option (B) omits the attribute name before the operator and uses LIKE incorrectly without a column specification.
Option (C) only projects Name and DOB, failing to return all student details, and uses the inequality operator (\(>\)) instead of checking for equality.
Option (D) incorrectly combines the set operator IN with the equality operator =, which creates a syntax error in SQL.
Final Answer:
The correct and syntactically valid query is option (A).
1. Use
SELECT * to project all attributes.2. Use
WHERE column = ’value’ for strict string equality matching.3.
IN expects a parenthesized list like WHERE column IN (’A’, ’B’).Which Sql Statements correctly retrieves records from a ’Commodity’ table where the Price is either above 1000 or the product Category is ’Sales’?
View Solution
Concept:
Filtering queries in SQL often require combining multiple criteria using logical operators.
The primary logical operators in standard SQL are AND, OR, and NOT.
Step 1: Translating the Logical Condition:
The question requires records where:
1. The Price is greater than 1000: expressed as Price > 1000.
2. OR the product Category equals ’Sales’: expressed as Category = ’Sales’.
When either condition being true is sufficient to select the row, the logical connective OR must be used.
The complete valid SQL statement is:
SELECT * FROM Commodity WHERE Price > 1000 OR Category = ’Sales’;
Step 2: Checking Flaws in the Distractors:
Option (B) uses the logical operator AND, which would restrict the output strictly to rows where both conditions are simultaneously satisfied.
Option (C) replaces the mandatory WHERE keyword with IF, which violates SQL syntax.
Option (D) uses || (which represents string concatenation in standard ANSI SQL) and omits quotation marks around the string literal Sales.
Final Answer:
Option (A) is the grammatically and logically correct SQL statement.
OR when satisfaction of any single condition is acceptable.Use
AND when all listed conditions must be met simultaneously.SQL uses the English word
OR, unlike programming languages that use ||.Which query correctly finds a category in the ’Commodity’ table that has more than 5 products with a Price greater than 600?
View Solution
Concept:
In SQL, row filtering on individual record attributes is performed using the WHERE clause before aggregation.
Filtering on grouped results based on aggregate functions must be performed using the HAVING clause after the GROUP BY operation.
Step 1: Filtering Row-Level Conditions:
The problem statement states that products must have a Price > 600.
Because Price is an attribute of individual products, it must be evaluated using a WHERE clause before rows are placed into groups:
WHERE Price > 600
Step 2: Grouping and Group-Level Filtering:
Next, the qualifying individual products must be grouped by their respective categories:
GROUP BY category
Finally, the categories must have more than 5 such qualifying products, which is an aggregate property:
HAVING COUNT(*) > 5
Placing non-aggregate conditions like Price > 600 inside the HAVING clause (as in options A and C) is syntactically invalid because Price is not part of the GROUP BY clause or an aggregate function.
Final Answer:
Combining the clauses in the prescribed order of execution gives Option (B).
WHERE filters rows before grouping \(\rightarrow\) GROUP BY divides rows into groups \(\rightarrow\) HAVING filters groups.Never place individual non-aggregated column conditions into the
HAVING clause unless they are in the GROUP BY clause.Match List-I with List-II:
Choose the correct answer from the options given below:
View Solution
Concept:
SQL keywords and clauses provide specialized operations to query, filter, structure, and manipulate relational data sets.
Step 1: Functional Analysis of Each Clause:
1. DISTINCT (III): The DISTINCT keyword is placed directly after SELECT to eliminate duplicate values from the output, returning only unique records. Thus, (A) matches with (III).
2. WHERE (IV): The WHERE clause filters tuples from a table based on specified conditional criteria before any grouping occurs. Thus, (B) matches with (IV).
3. GROUP BY (I): The GROUP BY clause summarizes rows that have identical values in specified columns into aggregate summary rows. Thus, (C) matches with (I).
4. ORDER BY (II): The ORDER BY clause sorts the final result set in either ascending (ASC) or descending (DESC) order. Thus, (D) matches with (II).
Step 2: Alignment of Pairs:
The resulting configuration is:
(A) \(\rightarrow\) (III)
(B) \(\rightarrow\) (IV)
(C) \(\rightarrow\) (I)
(D) \(\rightarrow\) (II)
Final Answer:
This matches correctly with option (C).
-
DISTINCT = Remove duplicates.-
WHERE = Filter tuples.-
GROUP BY = Form summary groups.-
ORDER BY = Sort rows.Which of the following are multiple row functions?
(A) Sum
(B) Count
(C) Left
(D) Max
Choose the correct answer from the options given below:
View Solution
Concept:
SQL functions are broadly categorized into two major types:
1. Single Row (Scalar) Functions: Operate on a single value per row and return a single calculated value for each row.
2. Multiple Row (Aggregate) Functions: Accept values from multiple rows of a column as input and produce a single combined summary result.
Step 1: Evaluating the Given Functions:
- SUM(): Computes the total sum of numerical values across multiple rows. This is an aggregate/multiple row function.
- COUNT(): Returns the count of rows that match a specified criterion across multiple records. This is a multiple row function.
- LEFT(): Extracts a specified number of characters starting from the left side of an individual string. It operates independently on each row’s string value, making it a single-row string function.
- MAX(): Scans multiple rows of a given column to determine and return the maximum value. This is a multiple row function.
Step 2: Identifying Multiple Row Functions:
From the above breakdown, (A) SUM, (B) COUNT, and (D) MAX are multiple row functions, whereas (C) LEFT is a single row scalar function.
Final Answer:
The correct combination is (A), (B) and (D) only, represented by option (C).
SUM(), AVG(), COUNT(), MAX(), and MIN().String, mathematical, and date functions (like
LEFT, ROUND, NOW) are single-row functions.Arrange the evolution of networking as per the development timeline:
(A) The Berners-Lee at CERN developed HTML and URL, thus giving birth to World Wide Web (www).
(B) TCP/IP introduced as standard protocol on ARPANET.
(C) Roy Tomlinson develops network messaging or -mail symbol@ comes to mean "at".
(D) ARPANET became functional by connecting UCLA and SRI.
Choose the correct answer from the options given below:
View Solution
Concept:
Computer networking originated under military and research funding in the late 1960s and evolved through standardized communication protocols before culminating in the World Wide Web.
Step 1: Historical Timeline of Key Milestones:
1. 1969 - ARPANET initial deployment (D): ARPANET first became functional in 1969 by interconnecting the initial nodes at UCLA (University of California, Los Angeles) and SRI (Stanford Research Institute).
2. 1971 - Electronic Mail and ’@’ Symbol (C): Roy Tomlinson implemented the first network email on ARPANET in 1971, selecting the ‘@‘ sign to separate the user’s name from their host computer.
3. January 1, 1983 - Adoption of TCP/IP (B): On the official "flag day" in 1983, ARPANET adopted the Transmission Control Protocol / Internet Protocol (TCP/IP) suite as its standard communication protocol, giving birth to the modern Internet.
4. 1989-1991 - Invention of the World Wide Web (A): Tim Berners-Lee at CERN created HTML, HTTP, and URLs in 1989-1990, officially releasing the World Wide Web project to the public in 1991.
Step 2: Arranging in Chronological Sequence:
The chronological order from earliest to latest is:
(D) \(1969 \rightarrow\) (C) \(1971 \rightarrow\) (B) \(1983 \rightarrow\) (A) \(1990\).
Final Answer:
The sequence corresponds to (D), (C), (B), (A), which is option (B).
1969: ARPANET (UCLA & SRI) \(\rightarrow\) 1971: Roy Tomlinson email (@) \(\rightarrow\) 1983: TCP/IP standard protocol \(\rightarrow\) 1990: Tim Berners-Lee WWW / HTML.
Which of the following statement is CORRECT about GROUP BY clause in SQL?
View Solution
Concept:
The GROUP BY statement groups rows that have the same values in specified columns into summary rows (e.g., "find the average marks for each department").
Step 1: Evaluating the Role of GROUP BY:
In relational databases, GROUP BY collapses rows with identical attribute values into unique summary buckets.
It is typically paired with aggregate functions like SUM(), AVG(), MIN(), MAX(), and COUNT() to calculate statistical metrics over each group.
Therefore, statement (C) provides the correct definition and intended usage.
Step 2: Evaluating Distractor Statements:
- Statement (A) describes the ORDER BY clause, not GROUP BY.
- Statement (B) claims that it cannot be used with aggregate functions, which contradicts its primary design purpose.
- Statement (D) describes table operations such as JOIN or UNION, which combine data from multiple tables.
Final Answer:
Statement (C) correctly describes the functionality of the GROUP BY clause.
-
GROUP BY creates distinct subsets of matching data.- Aggregate functions (
COUNT, SUM, AVG) calculate values for each distinct group.A is an access point between an organization’s network and the outside world of the internet.
View Solution
Concept:
In computer networks, connecting two different networks with potentially dissimilar architectures, addressing protocols, or internal policies requires a specialized border device.
Step 1: Role of a Gateway:
A Gateway serves as the key entry and exit access point between an internal organization’s Local Area Network (LAN) and external networks such as the Internet.
It can operate at any layer of the OSI model, translating protocol formats when communication takes place between different systems.
In enterprise setups, gateways frequently integrate proxy servers, firewalls, and address translators (NAT) to manage traffic crossing network boundaries.
Step 2: Comparing with Other Devices:
A Switch is an intelligent data-link layer device that directs frames within the local local network to specific nodes via MAC addresses.
A Repeater is a physical layer device that boosts and regenerates attenuated signals along a cable run.
A Modem (modulator-demodulator) converts analog signals to digital signals and vice versa over transmission media like telephone or coaxial lines.
Final Answer:
The device serving as the access point between an organization’s local network and the Internet is a Gateway.
Modems handle signal modulation, while switches connect devices locally within the same network.
An analog device which regenerates the weakened signal appearing on the cable and puts them back is known as
View Solution
Concept:
As electrical or electromagnetic signals travel along network transmission cables, they encounter resistance, leading to loss of energy and signal degradation, a phenomenon called attenuation.
Step 1: Role and Mechanism of a Repeater:
A Repeater is a hardware device operating at the Physical Layer (Layer 1) of the OSI model.
Its primary function is to intercept weak, distorted incoming signals, amplify or reconstruct them to their original strength and shape, and retransmit them down subsequent cable segments.
This extends the maximum physical distance over which a local network can reliably operate without data corruption.
Step 2: Comparison with Other Options:
A Switch forwards frames using MAC addresses at Layer 2.
A Modem performs digital-to-analog and analog-to-digital signal conversion.
A Bridge connects and filters traffic between two separate LAN segments based on MAC addresses.
Final Answer:
The device that regenerates weakened signals along network cables is a Repeater.
Remember: Repeaters do not read packet addresses or inspect data; they purely restore signal waveforms.
Match List-I with List-II:
Choose the correct answer from the options given below:
View Solution
Concept:
Network devices perform specialized functions at different layers of networking to enable hardware interconnection, signal preservation, and data routing.
Step 1: Analyzing Each Device and Function:
1. Switch (A): An intelligent multiport networking device that maintains a MAC address table and forwards frames unicast directly to the intended destination node rather than broadcasting. This matches with (I).
2. Repeater (B): A physical device that regenerates and amplifies electrical signals across cables to overcome transmission loss. This matches with (II).
3. Hub (C): A multiport device that connects multiple wired devices; it operates as a shared medium where data received on one port is broadcast across all other ports. This matches with (III).
4. Ethernet Card / NIC (D): A hardware adapter installed inside a computer that provides a physical interface and unique MAC address to join the network. This matches with (IV).
Step 2: Matching Verification:
(A) corresponds to (I).
(B) corresponds to (II).
(C) corresponds to (III).
(D) corresponds to (IV).
Final Answer:
The matching pairs result in Option (A).
- Hub: Broadcasts to all connected ports.
- Switch: Unicasts intelligently to the destination device using MAC addresses.
- NIC/Ethernet Card: Hardware interface inside the computer.
The RJ in RJ-45 connector stands for :
View Solution
Concept:
Twisted-pair Ethernet cables (such as Cat 5e and Cat 6) use standard modular connectors to plug into Network Interface Cards (NICs), switches, and routers.
Step 1: Standard Definition:
The acronym RJ stands for Registered Jack.
A Registered Jack is a standardized telecommunication network interface for connecting voice and data equipment to local networks or public telephone systems.
Step 2: Characteristics of RJ-45:
The RJ-45 connector features an 8-position, 8-contact (8P8C) modular configuration.
It is the standard physical connector used for terminating twisted-pair Ethernet cables in local area computer networking.
Final Answer:
"RJ" stands for Registered Jack, making option (C) the correct choice.
- RJ-11: 4 or 6-wire connector used for standard telephone lines.
- RJ-45: 8-wire (8P8C) connector used for Ethernet computer networking.
Arrange the following statements in the correct sequence in order to write multiple strings to a file:
(A) myobj.close()
(B) lines= ["Hello everyone \(\backslash\)n", "writing multiple strings into file"]
(C) myobj.writelines(lines)
(D) myobj = open ("myfile.txt", ’w’)
Choose the correct answer from the options given below:
View Solution
Concept:
File input/output handling in Python follows a strict life cycle:
1. Open the file to create a file handle object with the desired access mode.
2. Prepare or initialize the data sequence (strings/lists).
3. Perform the reading or writing operation using file object methods.
4. Close the file object to release operating system resources and flush write buffers.
Step 1: Step-by-Step Program Flow:
- Step 1 (D): myobj = open("myfile.txt", ’w’) opens the target file in write mode, returning a valid file handle referenced by variable myobj.
- Step 2 (B): lines = ["Hello everyone \(\backslash\)n", "writing multiple strings into file"] initializes a list of string elements to be written.
- Step 3 (C): myobj.writelines(lines) takes the list of strings and writes each string element into the open file referenced by myobj.
- Step 4 (A): myobj.close() properly closes the file stream and saves all written content to the disk.
Step 2: Conclusion:
Attempting to write before opening or after closing triggers errors. Therefore, the logical sequence is (D), (B), (C), (A).
Final Answer:
The correct order is (D), (B), (C), (A), which corresponds to option (A).
open() \(\rightarrow\) prepare data \(\rightarrow\) write() / writelines() \(\rightarrow\) close().Never invoke
writelines() before creating the file handle via open().Stack follows the principle.
View Solution
Concept:
A stack is a linear, ordered collection of elements with a restricted access discipline where all insertions and deletions are performed exclusively at one end, known as the top of the stack.
Step 1: Defining the Stack Access Mechanism:
Because elements enter and exit from the same end (the top), the item added most recently is always the first one to be removed.
This operational rule is called LIFO (Last-In-First-Out), or equivalently FILO (First-In-Last-Out).
Primary operations on a stack include:
- push: Inserting an element onto the top.
- pop: Removing the top element.
Step 2: Comparing with Other Structures:
- First-In-First-Out (FIFO) defines a Queue, where insertion takes place at the rear and deletion takes place at the front.
- Enqueue and Dequeue are the standard naming conventions for inserting and deleting elements in a Queue.
Final Answer:
The stack data structure operates strictly on the Last-In-First-Out (LIFO) principle.
Queue \(\rightarrow\) FIFO (First-In, First-Out) \(\rightarrow\) insertion at Rear, deletion at Front.
The ’raise’ keyword in Python is used .
View Solution
Concept:
In Python, exception handling allows programs to intercept, handle, and trigger errors dynamically during runtime execution.
Step 1: Role of the ’raise’ Statement:
The raise keyword is used explicitly by a programmer to throw (or raise) an exception when a specific condition or business logic rule is violated.
For example:
if age < 18: raise ValueError("Age must be at least 18")
When the raise statement executes, the standard program flow stops immediately, and Python searches for an appropriate enclosing except block to handle the error.
Step 2: Differentiating Exception Keywords in Python:
- try: Encloses the block of code being monitored for errors.
- except: Catches and handles exceptions that occur within the try block.
- finally: Executes clean-up code unconditionally, regardless of whether an exception occurred or not.
- raise: Triggers an exception deliberately.
Final Answer:
The keyword raise is used to explicitly throw an exception.
try-except to handle exceptions raised by Python.Use
raise to deliberately throw an exception yourself.Which of the following statement is correct with respect to exception handling in python?
View Solution
Concept:
Python provides robust error-handling constructs using try, except, else, and finally blocks.
A single piece of monitored code can potentially encounter different runtime errors, such as ZeroDivisionError, ValueError, or FileNotFoundError.
Step 1: Assessing Multiple ’except’ Clauses:
A single try block can have multiple distinct except clauses attached to it.
This enables the program to handle different exception classes selectively and provide tailored recovery routines for each error type.
Thus, statement (A) is completely true.
Step 2: Checking the Other Statements:
- Statement (B) is incorrect because a finally block can be placed after any number of except blocks.
- Statement (C) is incorrect because raise is completely optional inside a try block; built-in exceptions are raised automatically by Python.
- Statement (D) is incorrect because an except clause cannot exist on its own; it requires a preceding try block.
Final Answer:
Statement (A) is the only correct statement regarding exception handling in Python.
try block must have at least one except or finally block.You can associate multiple
except blocks with one try to handle different exceptions separately.Which of the following methods is used to position a file object to a specific position in a file?
View Solution
Concept:
When working with files in Python, the file pointer indicates the current byte offset where the next read or write operation will take place.
Python provides built-in methods on file objects to inspect and modify this byte offset.
Step 1: Understanding seek():
The seek(offset, whence) method reposition the file pointer to a specific byte location within the file.
- offset defines how many bytes to move.
- whence is an optional reference point: 0 (beginning of file, default), 1 (current position), or 2 (end of file).
Hence, seek() sets the file pointer to a chosen location.
Step 2: Evaluating tell() and Other Options:
- tell() returns the current integer byte offset of the file pointer without modifying it.
- Neither peep() nor move() are valid built-in file object methods in Python.
Final Answer:
The method used to position a file pointer to a designated location is seek().
-
tell(): "Where am I?" (Returns current byte offset).-
seek(offset): "Go to this position" (Moves file pointer).Consider an empty stack. What will the stack look like (starting from the top) after executing the following operations in sequence?
1. push(7)
2. push(5)
3. push(9)
4. push(11)
5. pop()
6. push(22)
(A) 22
(B) 9
(C) 5
(D) 7
Choose the correct answer from the options given below:
View Solution
Concept:
A stack functions on the Last-In-First-Out (LIFO) order.
Pushing places an element on the top, while popping removes the element currently at the top.
Step 1: Tracing the Stack Operations Step-by-Step:
Let the stack contents be represented from bottom to top as a list:
1. Initial state: Stack = \([\,]\)
2. push(7): Stack = \([7]\)
3. push(5): Stack = \([7, 5]\)
4. push(9): Stack = \([7, 5, 9]\)
5. push(11): Stack = \([7, 5, 9, 11]\) (Top is 11)
6. pop(): Removes the topmost element, which is 11. Stack becomes \([7, 5, 9]\)
7. push(22): Stack = \([7, 5, 9, 22]\)
Step 2: Reading from the Top of the Stack:
Reading the stack elements from the top down to the bottom yields:
- Top: 22 \(\rightarrow\) corresponds to (A)
- Next: 9 \(\rightarrow\) corresponds to (B)
- Next: 5 \(\rightarrow\) corresponds to (C)
- Bottom: 7 \(\rightarrow\) corresponds to (D)
The resulting sequence from top to bottom is (A), (B), (C), (D).
Final Answer:
The stack from top to bottom is (A), (B), (C), (D), which is option (A).
In the below stack operation, what will be the output value for the variable ’result’?
result = 0
stack = [10, 20, 30]
stack.append(40)
result += stack.pop()
result += stack.pop()
View Solution
Concept:
In Python, standard lists can be used as stacks.
The append(x) method acts as push, adding an element to the end (top) of the list.
The pop() method without arguments removes and returns the last item (top) of the list.
Step 1: Step-by-Step Execution of the Code:
- Initially, result = 0.
- stack = [10, 20, 30].
- stack.append(40) pushes 40 onto the top of the stack.
The stack is now: [10, 20, 30, 40].
Step 2: Evaluating the Pop Operations:
- First pop: stack.pop() removes and returns the topmost element, 40.
result += 40 updates result to \(0 + 40 = 40\).
The stack is now: [10, 20, 30].
- Second pop: stack.pop() removes and returns the next topmost element, 30.
result += 30 updates result to \(40 + 30 = 70\).
The stack is now: [10, 20].
Final Answer:
The final calculated value of result is 70, which corresponds to option (A).
-
append() adds to the end (Top).-
pop() removes from the end (Top) in LIFO order.What will be the postfix equivalent of the expression \((A + B) * (C - D)\)?
View Solution
Concept:
In an infix expression, operators are placed between operands.
In a postfix (Reverse Polish) expression, operators are placed directly after their respective operands, eliminating the need for parentheses.
Step 1: Conversion Using Infix-to-Postfix Rules:
The expression is:
\[ (A + B) * (C - D) \] We evaluate sub-expressions according to operator precedence and parentheses:
1. First, convert the parenthesized sub-expression \((A + B)\):
The infix operator \(+\) moves behind operands \(A\) and \(B\):
\((A + B) \rightarrow AB+\)
2. Second, convert the parenthesized sub-expression \((C - D)\):
The infix operator \(-\) moves behind operands \(C\) and \(D\):
\((C - D) \rightarrow CD-\)
Step 2: Combining with the Outer Multiplication Operator:
Substitute the postfix forms back into the main expression:
\((AB+) * (CD-)\)
Here, \((AB+)\) is the first operand and \((CD-)\) is the second operand for the operator \(*\).
Moving \(*\) to the end gives:
\(AB+ \; CD- \; *\)
Final Answer:
The resulting postfix expression is AB + CD - *, which matches option (A).
Convert inner parenthesized sub-expressions first: \((A+B) \rightarrow AB+\), \((C-D) \rightarrow CD-\), then apply the outer operator \(* \rightarrow AB+CD-*\).
Which of the following elements will be present in a queue after the end of the following operation sequence? Assume the queue is empty initially.
enqueue(10)
enqueue(20)
enqueue(30)
dequeue()
enqueue(40)
dequeue()
enqueue(50)
enqueue(60)
(A) 60
(B) 30
(C) 20
(D) 50
Choose the correct answer from the options given below:
View Solution
Concept:
A queue operates on the First-In-First-Out (FIFO) principle.
The enqueue operation inserts an element at the rear of the queue, while the dequeue operation removes the element that has been in the queue the longest from the front.
Step 1: Tracing Queue State Changes:
Let the queue be represented as a list where the front is on the left and the rear is on the right:
1. enqueue(10): \([10]\)
2. enqueue(20): \([10, 20]\)
3. enqueue(30): \([10, 20, 30]\)
4. dequeue(): The front element 10 is removed. Queue: \([20, 30]\)
5. enqueue(40): \([20, 30, 40]\)
6. dequeue(): The front element 20 is removed. Queue: \([30, 40]\)
7. enqueue(50): \([30, 40, 50]\)
8. enqueue(60): \([30, 40, 50, 60]\)
Step 2: Checking the Final Queue Elements:
The remaining elements in the queue are \(30, 40, 50, 60\).
Matching these against the options provided:
- 60 is present \(\rightarrow\) (A)
- 30 is present \(\rightarrow\) (B)
- 20 is NOT present (it was dequeued in step 6)
- 50 is present \(\rightarrow\) (D)
Thus, the items from the list that remain in the queue are (A), (B), and (D).
Final Answer:
The elements present are (A), (B) and (D) only, which corresponds to option (A).
dequeue().Trace front deletions carefully to identify which elements remain.
Which of the following is a linear data structure?
(A) Deque
(B) Queue
(C) Stack
(D) Tree
Choose the correct answer from the options given below:
View Solution
Concept:
Data structures are classified based on how their data elements are arranged in memory and traversed:
1. Linear Data Structures: Elements are arranged sequentially or linearly, where each element has a unique predecessor and successor (except the first and last).
2. Non-Linear Data Structures: Elements are organized hierarchically or interconnected across multiple paths.
Step 1: Classifying the Given Data Structures:
- Deque (Double-Ended Queue): A linear sequence allowing insertion and deletion at both ends. It is a linear data structure.
- Queue: Follows a sequential FIFO organization. It is a linear data structure.
- Stack: Follows a sequential LIFO organization. It is a linear data structure.
- Tree: A hierarchical collection of nodes linked by directed or undirected edges consisting of roots, parents, and children. It is a non-linear data structure.
Step 2: Conclusion:
Deque (A), Queue (B), and Stack (C) are linear data structures, while Tree (D) is non-linear.
Final Answer:
The linear data structures are (A), (B) and (C) only, corresponding to option (A).
Non-linear data structures include: Trees and Graphs.
Which of the following statements is true in the context of a Deque?
View Solution
Concept:
A double-ended queue, commonly abbreviated as a Deque (pronounced “deck”), is a generalized linear data structure.
Unlike a standard queue which strictly follows the First-In-First-Out (FIFO) principle, a Deque allows elements to be added or removed from either the front or the rear end.
Because of this flexibility, it can be configured to act either as a First-In-Last-Out (FILO) stack or as a standard FIFO queue.
Step 1: Understanding the Structure of a Deque:
A Deque supports four primary operations for inserting and deleting elements:
1. insertFront(): Inserts an item at the front of the Deque.
2. insertRear(): Inserts an item at the rear of the Deque.
3. deleteFront(): Removes an item from the front of the Deque.
4. deleteRear(): Removes an item from the rear of the Deque.
These capabilities confirm that both insertion and deletion operations are entirely permissible at both ends.
Step 2: Evaluation of Options:
Restricting insertion to the rear and deletion to the front defines a standard linear queue, not a general Deque.
Restricting both operations exclusively to one end (either purely the front or purely the rear) models a stack.
Therefore, the defining and accurate statement regarding a Deque is that insertion and deletion can be carried out at both boundaries.
Final Answer:
Hence, the correct option is (B), stating that insertion and deletion can be done at both ends.
If restricted at one end, it becomes an Input-Restricted or Output-Restricted Deque.
By default, operations are available at both the front and rear ends.
Which of the following are the applications of binary search?
(A) Telephone Directory
(B) Finding the element with a minimum or maximum value in a sorted list
(C) Implementing routing tables
(D) Indexing in database
Choose the correct answer from the options given below:
View Solution
Concept:
Binary search is an efficient divide-and-conquer algorithm used to locate a specific target value within a sorted collection.
It operates with a logarithmic time complexity of \(O(\log n)\) by repeatedly comparing the target to the middle element and halving the search space.
Step 1: Analyzing Individual Applications:
(A) Telephone Directory:
A physical or electronic telephone directory is organized alphabetically (sorted order).
Searching for a name is efficiently accomplished using the divide-and-conquer principles of binary search.
(B) Finding an element with minimum or maximum value in a sorted list:
In specialized sorted arrangements, such as rotated sorted arrays or unimodal sequences, modified binary search is standardly applied to find extremes in \(O(\log n)\) time.
(D) Indexing in database:
Database systems organize index blocks (such as B-trees and B+ trees) in sorted order, applying binary search internally to rapidly traverse index nodes and fetch records.
(C) Implementing routing tables:
Network routing tables generally employ longest-prefix matching algorithms implemented via Trie data structures, hash tables, or specialized hardware like TCAM (Ternary Content-Addressable Memory), rather than basic binary search.
Step 2: Conclusion:
Statements (A), (B), and (D) directly represent recognized practical applications of binary search.
Final Answer:
Therefore, the correct choice is (A), which corresponds to (A), (B), and (D) only.
Any structure arranged in sorted order (dictionaries, database indexes, sorted arrays) utilizes binary search.
Routing tables prefer trie-based structures due to prefix matching requirements.
What happens even if a key is not present in the list during a linear search?
View Solution
Concept:
Linear search (or sequential search) is a fundamental search technique that makes no assumptions about the order of elements in the list.
It examines every item sequentially from the beginning to find a match with the desired key.
Step 1: Execution Mechanism of Linear Search:
The algorithm begins at index \(0\) and compares each element sequentially with the target key.
If the key matches an element, the search terminates successfully, returning the index.
Because the list is typically unsorted, the algorithm cannot conclude that a key is missing until it has inspected every single element.
Step 2: Analysis of Unsuccessful Search:
When the desired key is not present anywhere in the list, no match will be encountered.
Consequently, the loop continues iterating until it exhausts all \(n\) elements in the list.
It does not stop midway, skip elements, or raise a system error; it simply traverses the complete list before returning a failure flag (such as \(-1\)).
Final Answer:
The algorithm completely inspects the entire list when the search key is absent. Thus, option (D) is correct.
Never assume early termination unless the list is known to be ordered.
If a linear search is performed on 10 elements, how many comparisons will be needed in worst case?
View Solution
Concept:
The efficiency of a search algorithm is measured by the number of key comparisons performed as a function of the input size \(n\).
Linear search checks each element one by one from the first position to the last.
Step 1: Identifying Best, Average, and Worst Cases:
The best-case scenario occurs when the target element is at the first position, needing exactly \(1\) comparison.
The worst-case scenario occurs when the target key is located at the very last position (index \(n-1\)) or is not present in the list at all.
Step 2: Calculation for the Given List Size:
Given the total number of elements: \[ n = 10 \] In the worst-case scenario, the algorithm must compare the search key with every item in the collection: \[ \text{Worst-case comparisons} = n = 10 \] Each of the 10 elements must be evaluated before concluding the search.
Final Answer:
Exactly 10 comparisons will be needed in the worst case. Therefore, option (B) is the correct answer.
Best-case comparisons = \(1\).
Worst-case comparisons = \(n\).
Average-case comparisons = \(\frac{n+1}{2}\).
How many passes are required to sort a list of 6 elements using bubble sort?
View Solution
Concept:
Bubble Sort is an elementary comparison-based sorting algorithm.
It works by repeatedly stepping through the list, comparing adjacent elements, and swapping them if they are in the incorrect order.
Step 1: Determining the Number of Passes in Bubble Sort:
In a standard bubble sort implementation on an array of size \(n\):
- During pass 1, the largest element settles at its correct final position at the end of the array.
- During pass 2, the second largest element settles into the second-to-last position.
- In general, after \(k\) passes, the \(k\) largest elements are guaranteed to be in their final sorted positions.
When \(n - 1\) elements have been systematically placed into their correct positions, the remaining single element is naturally positioned correctly.
Step 2: Calculation for \(n = 6\):
Here, the number of elements is: \[ n = 6 \] The required maximum number of passes is given by the formula: \[ \text{Number of passes} = n - 1 \] Substituting \(n = 6\): \[ \text{Number of passes} = 6 - 1 = 5 \]
Final Answer:
Hence, 5 passes are required to sort the list of 6 elements. The correct option is (A).
Which sorting algorithm involves repeatedly selecting the smallest element and placing it in its correct position?
View Solution
Concept:
Sorting algorithms are classified by their internal mechanisms for ordering elements.
Selection Sort specifically works by partitioning the array into two sublists: a sorted sublist at the left and an unsorted sublist at the right.
Step 1: Mechanism of Selection Sort:
In Selection Sort, the algorithm continuously scans the unsorted segment of the array to locate the minimum (smallest) element.
Once the smallest element is identified, it is swapped with the first unsorted element, thereby appending it to the sorted segment.
This process of finding the smallest remaining element and placing it into its designated index repeats for each position in the list.
Step 2: Comparison with Other Algorithms:
- Bubble sort repeatedly swaps adjacent out-of-order pairs to float the largest value to the end.
- Insertion sort takes one element from the unsorted part and inserts it into its correct relative position within the already sorted part.
- Quick sort partitions the list around a pivot element.
Final Answer:
Selection Sort is precisely defined by repeatedly selecting the minimum element and placing it in position. Hence, option (B) is correct.
“Selecting the smallest element” \(\rightarrow\) Selection Sort.
“Swapping adjacent elements” \(\rightarrow\) Bubble Sort.
“Inserting into sorted sequence” \(\rightarrow\) Insertion Sort.
A loop within a loop will have the time complexity as .
View Solution
Concept:
Time complexity characterizes the growth rate of an algorithm’s running time relative to the input size \(n\).
When control structures such as loops are nested, their iteration counts multiply.
Step 1: Analyzing Nested Loops:
Consider a standard nested loop structure where an outer loop runs from \(1\) to \(n\):
For each iteration of the outer loop, an inner loop runs from \(1\) to \(n\).
The outer loop executes \(n\) times.
For every single execution of the outer loop, the inner loop executes \(n\) times.
Step 2: Calculating Total Iterations:
The total number of operations executed by the inner body is given by: \[ \text{Total operations} = n \times n = n^2 \] Expressed in Big-O notation, the asymptotic time complexity is quadratic: \[ O(n^2) \] This is the characteristic complexity seen in nested loops found in algorithms such as Bubble Sort and Selection Sort.
Final Answer:
A loop nested within another loop over the same input size yields a complexity of \(n^2\). Therefore, option (A) is correct.
Two nested loops of size \(n \rightarrow O(n^2)\).
Three nested loops of size \(n \rightarrow O(n^3)\).
Which of the following are examples of unstructured data?
(A) Writing tweets
(B) Recording a video
(C) Marking attendance by the teacher
(D) Filling a form for opening an account
Choose the correct answer from the options given below:
View Solution
Concept:
Data can be classified into structured, semi-structured, and unstructured formats:
- Structured data conforms to a rigid, predefined tabular data model (rows and columns with strict data types).
- Unstructured data lacks a predefined data model or organizational structure, making it difficult to store in conventional relational tables.
Step 1: Evaluating Each Given Activity:
(A) Writing tweets:
Tweets consist of natural language text, hashtags, emojis, and varied sentence lengths. This is qualitative text and constitutes unstructured data.
(B) Recording a video:
A video file consists of multimedia streams (pixels, frames, audio frequencies) that have no predefined relational row-and-column layout. Hence, it is unstructured data.
(C) Marking attendance by the teacher:
Attendance typically uses a predefined tabular sheet where rows represent students and columns represent dates with fixed values (Present/Absent). This represents structured data.
(D) Filling a form for opening an account:
An account form possesses designated fields (Name, DOB, Account Type) mapped directly to structured database records.
Step 2: Synthesis:
Only (A) and (B) represent unstructured data.
Final Answer:
The correct option is (A), which includes (A) and (B) only.
Forms, tables, spreadsheets, and database records represent structured data.
Calculate the standard deviation of the given temperature below recorded for the 7 days of a week:
24, 24, 21, 20, 26, 27, 30
View Solution
Concept:
Standard deviation (\(\sigma\)) is a statistical measure of the dispersion or variation of a set of data values relative to their mean.
It is computed as the square root of the variance.
Step 1: Key Formula:
The mean (\(\mu\)) of \(N\) values is: \[ \mu = \frac{\sum x_i}{N} \] The population standard deviation (\(\sigma\)) is given by: \[ \sigma = \sqrt{\frac{\sum (x_i - \mu)^2}{N}} \]
Step 2: Step-by-Step Computation:
The given data values for \(N = 7\) days are: \[ 24, 24, 21, 20, 26, 27, 30 \] Calculate the sum of values: \[ \sum x_i = 24 + 24 + 21 + 20 + 26 + 27 + 30 = 172 \] Calculate the arithmetic mean: \[ \mu = \frac{172}{7} \approx 24.57 \] Compute the deviations and their squares: \[ (24 - 24.57)^2 = (-0.57)^2 \approx 0.325 \] \[ (24 - 24.57)^2 = (-0.57)^2 \approx 0.325 \] \[ (21 - 24.57)^2 = (-3.57)^2 \approx 12.745 \] \[ (20 - 24.57)^2 = (-4.57)^2 \approx 20.885 \] \[ (26 - 24.57)^2 = (1.43)^2 \approx 2.045 \] \[ (27 - 24.57)^2 = (2.43)^2 \approx 5.905 \] \[ (30 - 24.57)^2 = (5.43)^2 \approx 29.485 \] Sum of squared deviations: \[ \sum (x_i - \mu)^2 \approx 0.325 + 0.325 + 12.745 + 20.885 + 2.045 + 5.905 + 29.485 = 71.71 \] Calculate the variance: \[ \sigma^2 = \frac{71.71}{7} \approx 10.244 \] Calculate the standard deviation: \[ \sigma = \sqrt{10.244} \approx 3.20 \]
Final Answer:
The standard deviation of the recorded temperatures is approximately 3.2. Thus, option (B) is the correct answer.
24.57 is the mean.
11.95 is the sample variance \(\frac{71.71}{6}\).
3.2 is the standard deviation (\(\sqrt{10.24} = 3.2\)).
Which measure of central tendency is better suited for dealing with an outlier?
View Solution
Concept:
Measures of central tendency summarize an entire dataset with a single representative value.
An outlier is an extreme data point that lies an abnormal distance from other values in a random sample.
Step 1: Evaluating the Impact of Outliers on Different Measures:
- The Mean incorporates the numerical value of every observation in its formula (\(\sum x / n\)). Consequently, extreme values pull the mean significantly in their direction, distorting the central tendency.
- The Median is a positional average determined strictly by ordering the dataset and selecting the middle element. Changing an extreme value does not affect the middle position, making it highly robust against outliers.
- The Mode represents the most frequently occurring value. However, a dataset may not have a mode or may have multiple modes, making it unreliable as a primary central measure for numeric distributions with outliers.
- The Range measures dispersion (Maximum \(-\) Minimum) rather than central tendency and is severely impacted by outliers.
Step 2: Conclusion:
Because the median is resistant to skewness and extreme values, it is the preferred measure of central tendency when outliers are present.
Final Answer:
Therefore, the Median is the most suitable measure. The correct option is (A).
Median is robust/resistant to outliers.
Always prefer the median for skewed data or datasets containing extreme anomalies.
Match List-I with List-II
Choose the correct answer from the options given below:
View Solution
Concept:
Relational Database Management Systems rely on fundamental structural terms to distinguish between the overall design, the current contents, the constraints, and the system metadata.
Step 1: Matching Concepts to Their Descriptions:
- (A) Database Schema: The overall logical and physical structure or skeleton of the database system. It defines tables, fields, and relationships, remaining relatively static. Thus, (A) matches with (III).
- (B) Database Instance: The actual collection of data information stored in the database at a particular point in time, often referred to as a snapshot or current state. Thus, (B) matches with (I).
- (C) Data Dictionary: Also known as the system catalog, it stores metadata—the data describing database structure, permissions, and tables. Thus, (C) matches with (IV).
- (D) Data Constraint: Rules applied on table columns to restrict the type or values of data that can be inserted (e.g., NOT NULL, CHECK, UNIQUE). Thus, (D) matches with (II).
Step 2: Formulating the Correct Pairing:
Combining these mappings gives: \[ \text{(A)-(III), (B)-(I), (C)-(IV), (D)-(II)} \]
Final Answer:
This sequence corresponds to option (A).
Instance = Snapshot at a given moment (changes with every INSERT/UPDATE/DELETE).
Dictionary = Catalog / Metadata.
Sometimes, on calling a customer service center, the Interactive Voice Response System (IVRS) tells us to wait till a support person is available. Which data structure this application is of?
View Solution
Concept:
Real-world waiting lines where the earliest arriving participant is served first operate under the First-In-First-Out (FIFO) paradigm.
In computer science, this scheduling policy is implemented using a Queue data structure.
Step 1: Analyzing the Call Center IVRS Mechanism:
When multiple customers call customer support, agents can only assist one person at a time.
Callers who arrive while all agents are busy are placed on hold in a waiting line.
The caller who has been waiting the longest (arrived first) is connected to the next available agent.
This directly implements First-In-First-Out (FIFO) order: the first call entering the queue is the first one attended to.
Step 2: Evaluating the Options:
- Queue: The data structure that stores items in FIFO order.
- Stack: A LIFO structure where the newest caller would be answered first, which is unfair for customer support.
- Binary tree: A hierarchical structure used for searching or sorting, not linear waiting queues.
- Enqueue: The operation of adding an element to a queue, not a data structure itself.
Final Answer:
The waiting line system in IVRS is an application of a Queue. Thus, option (D) is the correct answer.
Calculate the degree and cardinality of the given relation below:
View Solution
Concept:
In relational database terminology:
- The Degree of a table (relation) is the total number of attributes (columns) present in that relation.
- The Cardinality of a relation is the total number of tuples (rows or records) stored in the relation, excluding the attribute header row.
Step 1: Calculating the Degree:
Count the vertical columns defined in the table:
1. ID
2. Name
3. Email
4. Address
5. Phone No.
Total number of attributes = 5.
Therefore, \(\text{Degree} = 5\).
Step 2: Calculating the Cardinality:
Count the distinct data rows (tuples) present:
1. Record of Ajay (ID 001)
2. Record of Amit (ID 002)
3. Record of Ashu (ID 003)
4. Record of Ashok (ID 004)
Total number of tuples = 4.
Therefore, \(\text{Cardinality} = 4\).
Final Answer:
The relation has a Degree of 5 and a Cardinality of 4. This matches option (B).
Degree = Number of Columns (Attributes).
Cardinality = Number of Rows (Tuples).
Do not count the header row in cardinality!
Suppose you want to select distinct salaries working in department 101 from the ’Employee’ relation. What will be the correct order of writing the query?
(A) FROM Employee
(B) SELECT
(C) WHERE
(D) DISTINCT Salary
(E) Dept_ID= 101
Choose the correct answer from the options given below:
View Solution
Concept:
Structured Query Language (SQL) adheres to a strict syntax grammar when constructing Data Query Language (DQL) statements.
The standard clause order for a basic filtering query is: \[ \text{SELECT} \rightarrow \text{attribute list} \rightarrow \text{FROM} \rightarrow \text{table} \rightarrow \text{WHERE} \rightarrow \text{conditions} \]
Step 1: Identifying the Target SQL Query:
The goal is to retrieve unique values of Salary from the Employee table for employees belonging to department 101.
The correct SQL statement is:
SELECT DISTINCT Salary FROM Employee WHERE Dept_ID = 101;
Step 2: Ordering the Given Components:
Mapping each snippet:
1. SELECT \(\rightarrow\) (B)
2. DISTINCT Salary \(\rightarrow\) (D)
3. FROM Employee \(\rightarrow\) (A)
4. WHERE \(\rightarrow\) (C)
5. Dept_ID = 101 \(\rightarrow\) (E)
Thus, the correct grammatical sequence is (B), (D), (A), (C), (E).
Final Answer:
The sequence that builds the valid SQL query is (B), (D), (A), (C), (E). Hence, option (C) is correct.
SELECT \(\rightarrow\) FROM \(\rightarrow\) WHERE \(\rightarrow\) GROUP BY \(\rightarrow\) HAVING \(\rightarrow\) ORDER BY.
The DISTINCT keyword must directly follow SELECT.
is a search technique that makes use of the ordering of elements in the list to quickly search for a key.
View Solution
Concept:
Searching algorithms locate the position of an item within a collection.
Some search techniques can work on arbitrary unsorted collections, whereas others rely fundamentally on the sorted order of elements to accelerate search time.
Step 1: Mechanism of Binary Search:
Binary search relies strictly on the sorted sequence of the elements.
Because the list is ordered, comparing the key to the middle element determines whether the target lies in the left half or the right half.
This eliminates half of the remaining elements in each step, reducing the search space exponentially.
Step 2: Evaluating the Distractors:
- Linear search sequentially checks items without relying on or benefiting from element ordering.
- Hashing computes an index directly using a mathematical hash function, without using list ordering.
- Bubble search is not a standard search technique (Bubble Sort is a sorting algorithm).
Final Answer:
Binary search is the algorithm that leverages list ordering to achieve efficient searches. Thus, option (B) is correct.
Time complexity: \(O(\log n)\).
Sales
What is the result of the following query with respect to given relation ’Sales’?
SELECT COUNT(DISTINCT customer_id) FROM Sales;
View Solution
Concept:
The COUNT() aggregate function in SQL returns the number of values that match a specified condition.
When paired with the DISTINCT keyword, it eliminates duplicate entries before counting, computing the number of unique non-null values in that column.
Step 1: Identifying the Values in the Specified Column:
The column specified in the query is customer_id.
Extracting all entries from the Sales table for customer_id:
- Row 1: C101
- Row 2: C102
- Row 3: C103
- Row 4: C101
Step 2: Applying the DISTINCT Qualifier:
The DISTINCT keyword filters the extracted list so that only unique identifiers remain:
Unique values: \(\{ \text{C101}, \text{C102}, \text{C103} \}\).
Notice that the duplicate entry C101 is considered only once.
Step 3: Evaluating COUNT():
The COUNT function counts the elements in the unique set: \[ \text{Count} = 3 \]
Final Answer:
The query returns 3. Therefore, option (C) is the correct answer.
COUNT(customer_id) counts all rows = 4.COUNT(DISTINCT customer_id) counts unique entries = 3.Always remove duplicates first when evaluating
DISTINCT.Which protocol is used to format and transmit the information from the World Wide Web?
View Solution
Concept:
Web browsing and the World Wide Web (WWW) rely on communication protocols to standardize how web servers and clients (browsers) package, format, and exchange hypertext documents and multimedia resources.
Step 1: Role of HTTP:
HyperText Transfer Protocol (HTTP) is the foundational application layer protocol of the World Wide Web.
It dictates how messages are formatted, transmitted, and interpreted by browsers and web servers, defining actions such as GET, POST, and response status codes.
Step 2: Examining Other Listed Protocols:
- FTP (File Transfer Protocol): Used specifically to upload and download files between a client and server, not for formatting hypermedia documents on the WWW.
- TCP (Transmission Control Protocol): Operates at the transport layer to provide reliable, connection-oriented data delivery via segment numbering and acknowledgments.
- DNS (Domain Name System): Resolves human-readable domain names into numerical IP addresses.
Final Answer:
HTTP is the protocol that formats and transmits web information. The correct option is (C).
HTTP/HTTPS: Web page transmission.
FTP: File transfers.
DNS: Domain name resolution.
TCP: Reliable packet transmission.
Match List-I with List-II
Choose the correct answer from the options given below:
View Solution
Concept:
Network topology describes the physical or logical arrangement of nodes, devices, and connecting links within a computer network.
Step 1: Matching Topologies to Characteristics:
- (A) Star Topology: All nodes are individually connected to a central connecting device, such as a hub or switch. Thus, (A) corresponds to (II).
- (B) Bus Topology: Devices connect to a single central shared transmission line called a backbone cable. Thus, (B) corresponds to (I).
- (C) Ring Topology: Each node connects to exactly two neighboring nodes, forming a continuous circular loop where data typically travels in a single, unidirectional link. Thus, (C) corresponds to (III).
- (D) Hybrid Topology: Combines two or more different topologies (e.g., star-bus or star-ring), resulting in multiple hierarchical branches. Thus, (D) corresponds to (IV).
Step 2: Identifying the Correct Code Sequence:
The matching pairs are: \[ \text{(A)-(II), (B)-(I), (C)-(III), (D)-(IV)} \]
Final Answer:
This matches option (D).
Star \(\rightarrow\) Central hub/switch.
Bus \(\rightarrow\) Single backbone cable.
Ring \(\rightarrow\) Token / Unidirectional loop.
Hybrid \(\rightarrow\) Combination / Multiple branches.
What describes the work of a repeater?
View Solution
Concept:
As data signals travel along physical transmission cables, they lose strength due to resistance, attenuation, and environmental noise.
A repeater is a physical layer networking device designed to extend the maximum reach of a network cable segment.
Step 1: Function of a Repeater:
When an electrical or optical signal travels over long distances, it undergoes attenuation.
A repeater receives this incoming, degraded signal, amplifies or regenerates it bit-by-bit back to its original strength and shape, and retransmits it onto subsequent segments.
Step 2: Evaluating Other Options:
- Resolving domain names to IP addresses is the role of a DNS server.
- A unique hardware address refers to a MAC address burned into a network interface card (NIC).
- Circuit switching is a connection-oriented communication method used in traditional telephone networks.
Final Answer:
The primary function of a repeater is to regenerate weak signals. Hence, option (A) is correct.
They regenerate and clean up signals rather than merely amplifying noise.
What is the measurment unit of bandwidth?
View Solution
Concept:
Bandwidth refers to the data-carrying capacity of a transmission medium.
Depending on whether the channel is analyzed in the analog frequency domain or the digital data domain, bandwidth is quantified in cycles per second or bits per second.
Step 1: Evaluating Units for Bandwidth:
- In analog systems and fundamental telecommunications, bandwidth is defined as the width of the frequency band allocated for transmission (the difference between the upper and lower cutoff frequencies). Its standard unit of measurement is Hertz (Hz), along with its multiples (kHz, MHz, GHz).
- In digital networks, transmission speed is often expressed in bits per second (bps).
Step 2: Evaluating the Given Options:
- Hertz (Hz) is the standard SI unit for frequency and analog transmission bandwidth.
- Kilobytes and Megabytes measure storage capacity or volume of data, not rates or bandwidth.
- Milliseconds measure time or latency.
Final Answer:
Hertz is the recognized unit of measurement for bandwidth among the choices. Thus, option (A) is correct.
Digital bandwidth / data transfer rate \(\rightarrow\) bits per second (bps).
Bytes (KB, MB) quantify data size/volume, not transmission bandwidth.
What is the range of frequency for radio waves?
View Solution
Concept:
Unguided (wireless) media transmit electromagnetic signals without physical conductors.
The electromagnetic spectrum used for wireless telecommunications spans radio waves, microwaves, and infrared light, categorized by their distinct frequency ranges.
Step 1: Standard Electromagnetic Frequency Classifications:
- Radio waves occupy the frequency range from 3 kHz up to 300 GHz. They are omnidirectional, meaning signals propagate in all directions from the antenna and can penetrate walls.
- Microwaves typically span from 300 MHz (or 1 GHz) up to 300 GHz and are unidirectional, requiring line-of-sight propagation.
- Infrared waves cover 300 GHz to 400 THz, used for short-range communication like remote controls.
Step 2: Conclusion:
According to standard computer networking curriculum (NCERT Class 12 Computer Science), the recognized frequency spectrum designated for radio wave propagation is 3 kHz to 300 GHz.
Final Answer:
The frequency range for radio waves is 3 KHz to 300 GHz. Option (A) is correct.
Radio waves: \(3\text{ kHz} - 300\text{ GHz}\).
Microwaves: \(300\text{ MHz} - 300\text{ GHz}\).
Infrared: \(300\text{ GHz} - 400\text{ THz}\).
Consider the following numList:
Sequence the following output obtained after each pass of comparison using bubble sort.
Choose the correct answer from the options given below:
View Solution
Concept:
Bubble sort iteratively compares adjacent elements and swaps them if the left element exceeds the right element.
In each successive pass, the largest remaining unsorted value bubbles up to its final position at the end of the array.
Step 1: Tracing Pass 1:
Initial list: \([8, 7, 13, 1, -9, 4]\)
- Compare 8 and 7 \(\rightarrow 8 > 7\), swap: \([7, 8, 13, 1, -9, 4]\)
- Compare 8 and 13 \(\rightarrow 8 \le 13\), no swap: \([7, 8, 13, 1, -9, 4]\)
- Compare 13 and 1 \(\rightarrow 13 > 1\), swap: \([7, 8, 1, 13, -9, 4]\)
- Compare 13 and \(-9 \rightarrow 13 > -9\), swap: \([7, 8, 1, -9, 13, 4]\)
- Compare 13 and 4 \(\rightarrow 13 > 4\), swap: \([7, 8, 1, -9, 4, 13]\)
Result of Pass 1: \([7, 8, 1, -9, 4, 13]\), which matches (A).
Step 2: Tracing Pass 2:
Current list: \([7, 8, 1, -9, 4, 13]\)
- Compare 7 and 8 \(\rightarrow\) no swap
- Compare 8 and 1 \(\rightarrow\) swap: \([7, 1, 8, -9, 4, 13]\)
- Compare 8 and \(-9 \rightarrow\) swap: \([7, 1, -9, 8, 4, 13]\)
- Compare 8 and 4 \(\rightarrow\) swap: \([7, 1, -9, 4, 8, 13]\)
Result of Pass 2: \([7, 1, -9, 4, 8, 13]\), which matches (B).
Step 3: Tracing Pass 3:
Current list: \([7, 1, -9, 4, 8, 13]\)
- Compare 7 and 1 \(\rightarrow\) swap: \([1, 7, -9, 4, 8, 13]\)
- Compare 7 and \(-9 \rightarrow\) swap: \([1, -9, 7, 4, 8, 13]\)
- Compare 7 and 4 \(\rightarrow\) swap: \([1, -9, 4, 7, 8, 13]\)
Result of Pass 3: \([1, -9, 4, 7, 8, 13]\), which matches (D).
Step 4: Tracing Pass 4:
Current list: \([1, -9, 4, 7, 8, 13]\)
- Compare 1 and \(-9 \rightarrow\) swap: \([-9, 1, 4, 7, 8, 13]\)
Result of Pass 4: \([-9, 1, 4, 7, 8, 13]\), which matches (C).
Final Answer:
The chronological order of passes is (A), (B), (D), (C). Therefore, option (C) is correct.
Pass 1 fixes 13 at the end.
Pass 2 fixes 8 at the second-to-last position.
Pass 3 fixes 7 at its spot, and so on.
Match List-I with List-II
Choose the correct answer from the options given below:
View Solution
Concept:
Malware (malicious software) is an overarching term for programs designed to disrupt, compromise, or gain unauthorized access to computer systems and personal data.
Step 1: Analyzing Each Malware Type:
- (A) Keylogger: Software or hardware designed to monitor and record every keystroke made by the user, storing credentials and sensitive inputs to transmit them to an unauthorized party. Thus, (A) maps to (II).
- (B) Adware: Software that displays unwanted advertisements and generates revenue for its author on a pay-per-click basis. Thus, (B) maps to (I).
- (C) Spyware: Software that covertly tracks user activity, internet browsing history, and habits, typically monetizing this behavioral data by selling it to third-party marketing agencies. Thus, (C) maps to (IV).
- (D) Worm: A self-contained, standalone malicious program that autonomously replicates itself across networks without needing a host file or user activation. Thus, (D) maps to (III).
Step 2: Verifying the Matches:
The matching pairs are: \[ \text{(A)-(II), (B)-(I), (C)-(IV), (D)-(III)} \]
Final Answer:
This matches option (B).
Adware \(\rightarrow\) Unwanted ads / Pay-per-click revenue.
Spyware \(\rightarrow\) Spying on internet usage data.
Worm \(\rightarrow\) Standalone self-replicating network program.
Which statement is true about a Trojan?
View Solution
Concept:
A Trojan horse (or simply Trojan) is a type of malware that conceals its malicious intent by masquerading as a legitimate, harmless program, such as a utility or game.
Step 1: Characteristics of a Trojan:
- Unlike computer viruses, a Trojan does not insert its code into other executable files.
- Unlike computer worms, a Trojan cannot replicate itself autonomously over a network.
- It spreads primarily through social engineering, where users are tricked into downloading and executing it.
Once installed, it can delete files, steal credentials, open backdoors, or spy on the system.
Step 2: Evaluating the Options:
- Statement 1 is false because a Trojan is an established category of malware.
- Statement 2 is true because Trojans notably lack self-replication and file-infection capabilities.
- Statement 3 is false because Trojans frequently corrupt, alter, or steal critical user files.
- Statement 4 is false because Trojans rely specifically on user interaction (downloading and running the deceptive file) to spread.
Final Answer:
The accurate statement is that a Trojan does not self-replicate or infect other files. Thus, option (B) is correct.
Viruses infect other files and self-replicate with user execution.
Worms self-replicate autonomously across networks.
Trojans disguise as legitimate software and do NOT self-replicate.
Which malware type disguises itself as legitimate software?
View Solution
Concept:
Malware variants employ distinct social engineering and infection vectors.
The method of deception where a program presents itself as authentic, useful software while concealing a malicious payload is derived from the classical Greek tale of the Trojan Horse.
Step 1: Identifying the Masquerading Behavior:
A Trojan horse specifically disguises itself as legitimate or harmless software (e.g., an antivirus scanner, game, driver updater, or media player).
Users are deceived into downloading and executing the application.
Once executed, the Trojan drops its malicious payload, which may grant backdoor administrative control to an attacker or compromise confidential files.
Step 2: Evaluating Other Options:
- Spyware covertly monitors user behavior and keystrokes without necessarily pretending to be a complete software application.
- Adware serves unauthorized advertisements and pop-ups.
- A Virus attaches itself to an existing valid executable host file and spreads when the host file is shared.
Final Answer:
The malware type that disguises itself as legitimate software is a Trojan. Therefore, option (D) is correct.
“Disguises itself as legitimate/useful software” \(\rightarrow\) Trojan.
“Attaches to existing files” \(\rightarrow\) Virus.
“Spreads on its own without user action” \(\rightarrow\) Worm.
CUET UG 2026 Exam Pattern
| Parameter | Details |
|---|---|
| Exam Name | Common University Entrance Test (CUET UG) 2026 |
| Conducting Body | National Testing Agency (NTA) |
| Exam Mode | Computer-Based Test (CBT) |
| Exam Duration | 60 minutes per test |
| Total Sections | 3 (Languages, Domain Subjects, General Test) |
| Question Type | Multiple Choice Questions (MCQs) |
| Questions per Test | 50 questions (all compulsory) |
| Marking Scheme | +5 for correct, -1 for incorrect |
| Maximum Marks | 250 marks per test |
| Maximum Subject Choices | 5 subjects in total |
| Syllabus Base | Class 12 NCERT (mainly for Domain Subjects) |








Comments