0% found this document useful (0 votes)
7 views3 pages

2marks

The document provides definitions and explanations of various computer science concepts including prefix and postfix expressions, applications of queues, collision resolution in hashing, and data types in SQL. It also covers network devices, data communication, stack implementation in Python, and database uses in real life. Additionally, it discusses bus topology, switching techniques, the UNIQUE constraint, the INSTR() function in MySQL, URLs, and the Point-To-Point protocol.

Uploaded by

chethanms354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

2marks

The document provides definitions and explanations of various computer science concepts including prefix and postfix expressions, applications of queues, collision resolution in hashing, and data types in SQL. It also covers network devices, data communication, stack implementation in Python, and database uses in real life. Additionally, it discusses bus topology, switching techniques, the UNIQUE constraint, the INSTR() function in MySQL, URLs, and the Point-To-Point protocol.

Uploaded by

chethanms354
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. What is prefix and postfix expression?

 Prefix-OPERATOR is written before the OPERAND [eg:+ab]


 Postfix-OPERATOR is written after the OPERAND [eg:ab+]

2. Write any two applications of queues in computer science.


 Web Server Requests
 Multitasking Operating Systems
 Print Queue

3. What is collision situation and collision resolution in hashing?


 Collision situation:Collision happens when two different keys get the same hash value in the hash table.
 Collision resolution:Collision resolution is the method used to handle collision so that all elements can be
stored properly in a hashing table

4. Write the rules which are imposed on an attribute of the relation.


(i) NOT NULL/ not null: It ensures that a column cannot have null values.
(ii) UNIQUE/unique: It ensures that all the values in a column are distinct(different) or unique.

5. Give the difference between char and varchar data types in SQL.
char(n)/CHAR(n): varchar(n)/VARCHAR(n):
 It specifies character datatype.  It specifies Variable Length datatype.
 Unused spaces are padded with blanks.  Only the actual number of characters are stored

6. Mention any two network devices.


 Modem Repeater
 NIC Router
 RJ45 HUB

7. Define data and communication


 Data-Raw facts and figures which has no meaning
 Communication-Transmission of data from one device to another

8. Write implementation of stack in python to check whether the stack is empty or not.
def isEmpty(glassStack):
return len(glassStack) == 0

[Link] the elements z, x and c perform enqueue and dequeue operations.


Enqueue adds an element to the rear (end) of the queue
Start with an empty queue: []
Enqueue z → [z]
Enqueue x → [z, x]
Enqueue c → [z, x, c]
dequeue removes and returns the element from the front (beginning)
First dequeue → removes z → [x, c]
Second dequeue → removes x → [c]
Third dequeue → removes c → []

10. Define the terms a) Hashing b) Perfect hash function


 Hashing:Hashing is a method of converting a key into a number(hash value) so data can be stored and found
quickly in a hash table
 Perfect hash function:A perfect hash function is one that gives a unique hash value for each key so no
collision occur.

[Link] any two uses of database in real life application.


 Banking: Customer details, accounts, loans, transactions.
 Online Shopping: Product descriptions, user login details, preferences.

[Link] delete statement is used for? Write its syntax.


The DELETE statement is used in SQL to remove one or more rows from a table.
DELETE FROM table_name;

13. Write a note on bus topology.


All devices are connected to a single central cable, or bus.
 Pros: Simple and inexpensive.
 Cons: A break in the bus can take down the entire network, and troubleshooting can be difficult.
Example: Temporary and small network

[Link] different types of switching techniques.


 Circuit switching
 Packet switching
 Message switching

[Link] appropriate syntax explain PUSH operation on stack using Python


PUSH adds an element to the top of the stack.
stack = [] # empty stack
[Link](element)

16. List out two operations on double ended queue

Operation Description

insertFront(x) Adds an element to the front of the deque.

insertRear(x) Adds an element to the rear (back) of the deque.

deleteFront() Removes the element from the front of the deque.

deleteRear() Removes the element from the rear (back) of the deque.

17. Mention any two applications of modified binary search


 Implementing routing tables in routers
 Data compression code etc.

18. Explain the role of UNIQUE constraint in a database


 It ensures that all the values in a column are distinct or unique.
 Prevents duplicate entries. [eg:Regno]

19. Describe INSTR() function in MySql


 INSERT() statement in MySQL is used to add new records (rows) into a table
 It is a DML command
Syn:INSERT INTO table_name(col1,col2 etc)VALUES(value1,value2);

20. What is URL? Explain.


It is a unique address used to locate resources on the web. It is commonly known as URL (Uniform Resource Locator)
or web address.
 Every webpage, file, or resource on the web has its own unique URL
 Ex: [Link]

21. Explain Point-To-Point protocol


 Direct connection
 PPP is a communication protocol which establishes a direct link between two network nodes over serial or
dial-up connections

You might also like