Kerala Plus Two Computer Science (DHSE) flashcards
Kerala Plus Two Computer Science (DHSE) · Build recall with a focused review session.
32 cards. Read the term and the definition here. The deck at the top of this page is optional.
- Structure member access
- A structure variable accesses members with the dot operator, as in s.name. A pointer to a structure uses the arrow operator, p->name, which is shorthand for (*p).name.
- Pointer dereference
- The unary * operator accesses the value stored at the address held by a pointer. The pointer's declared type determines how many bytes are read and how they are interpreted.
- new and delete
- new allocates heap memory at run time and returns a pointer; delete releases it. For arrays use new[] and delete[]. Missing delete leaks memory; double delete is undefined behaviour.
- Row-major address formula
- In a two-dimensional array with C columns and element size S bytes, the address of a[i][j] equals base + (i * C + j) * S, since rows are stored consecutively.
- Stack LIFO rule
- A stack allows insertion and deletion only at one end, the top. The last element pushed is the first popped, so push and pop are both constant-time O(1) operations.
- Circular queue condition
- In a circular queue of capacity n, the next rear index is (rear + 1) % n. The queue is full when that index equals front; this reuses slots freed by dequeue.
- Infix to postfix stack
- Operators are held on a stack while converting infix to postfix. An operator is popped to output when one of higher or equal precedence arrives, respecting parentheses.
- Binary search requirement
- Binary search repeatedly halves a sorted array, giving O(log n) time. It requires random access by index, so it suits arrays but is impractical on linked lists.
- Linked list node
- A self-referential structure holding data and a pointer to the next node of the same type. Nodes need not be contiguous; the final node's next pointer is NULL.
- Linked list deletion cost
- Deleting a node at a known position is O(1): relink the predecessor to the successor, then free the node. Locating the position by traversal costs O(n).
- Dangling pointer
- A pointer that still holds the address of memory already freed by delete. Dereferencing it is undefined behaviour, so set the pointer to NULL after deletion.
- Head and tail pointers
- A singly linked list stores a head pointer to its first node. A queue also keeps a tail pointer so enqueue at the rear stays O(1) instead of O(n).
- Encapsulation
- Bundling data and the functions that operate on it inside a class, with private members hidden from outside code and reachable only through public member functions.
- Run-time polymorphism
- A base-class pointer or reference calls a virtual function, and the version belonging to the actual derived object executes. Resolution happens at run time through the vtable.
- Abstract class
- A class containing at least one pure virtual function, declared with = 0. It cannot be instantiated directly but serves as an interface for derived classes to implement.
- Function overloading
- Declaring several functions with the same name but different parameter lists in the same scope. The compiler chooses by argument count and types at compile time.
- Copy constructor
- A constructor taking a reference to the same class, used to initialise a new object from an existing one. It runs on pass-by-value and on initialisation from an object.
- Constructor execution order
- When a derived object is created, the base constructor runs first, then derived member initialisation in declaration order, then the derived constructor body.
- Virtual destructor
- Declaring the base destructor virtual ensures that deleting a derived object through a base pointer runs the derived destructor before the base destructor, avoiding leaks.
- Primary key
- An attribute or minimal set of attributes that uniquely identifies each tuple in a relation. It cannot contain NULL values and every relation has at most one.
- WHERE versus HAVING
- WHERE filters individual rows before grouping; HAVING filters groups after GROUP BY and aggregation, so aggregate conditions such as COUNT(*) > 3 belong in HAVING.
- Referential integrity
- A foreign key value must match an existing primary key value in the referenced relation, or be NULL. It prevents orphan rows and is enforced by the database.
- CSS specificity order
- When rules conflict, inline styles beat id selectors, which beat class selectors, which beat element selectors. Among equal specificity, the later rule wins.
- CSS box model
- Each element occupies content, then padding, border and margin. With box-sizing: border-box, the declared width includes padding and border but not margin.
- Client-side validation
- Checking form input in the browser with JavaScript gives fast feedback but can be bypassed, so the server must repeat every validation before storing or processing data.
- PHP superglobal $_POST
- An associative array holding form values submitted with method="post". The data travels in the request body rather than the URL, unlike values in $_GET.
- PHP sessions versus cookies
- Session data is stored on the server and linked to the client by a session ID; cookies are stored on the client and can be read or altered by the user.
- SQL injection defence
- Using prepared statements with bound parameters separates SQL code from user data, so input cannot alter the query structure. Escaping alone is weaker protection.
- TCP versus UDP
- TCP is connection-oriented and reliable, with acknowledgements, retransmission and ordered delivery. UDP is connectionless with no guarantees, suiting streaming and DNS queries.
- DNS and DHCP roles
- DNS maps human-readable domain names to IP addresses. DHCP automatically assigns IP addresses and related configuration to devices joining a network.
- Cloud service models
- IaaS supplies virtual machines and storage, PaaS supplies a managed runtime for deploying applications, and SaaS supplies finished applications accessed over the network.
- Digital signature keys
- The sender signs with a private key and any receiver verifies with the matching public key, proving origin and integrity and preventing the sender from denying the message.