Deletion From Link List

Duration: 5 min

This video lesson is available to enrolled students.

Return to /learn/COGNIZANT-PREPARATION/data-structures/linked-list/sll-basics-standard-operations/asset-deletion-from-link-list after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Communication Round: Vocabulary, Subject Verb Agreement (Verb Noun Agreement), Tenses, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Direct and Indirect Speech, Active Passive Voice (Voice), Verbal Analogy (Word Based Analogy), Articles, Preposition, Conjunction, Sentence Construction, English Writing Ability, Communication Assessment
  2. Quantitative Aptitude: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Speed Time and Distance, Percentage, Average, Powers and Exponents (Surds and Indices), Time and Work, Mensuration and Geometry, Age Problems, Pipe and Cistern, Probability, Profit and Loss, Simple Interest and Compound Interest, Algebra
  3. Analytical and Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Directions (Direction Test), Ranking, Order and Sequence, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Logical Sequence Of Words, Puzzle Solving (Puzzles), Syllogisms, Seating Arrangements, Calendar, Clock, Blood Relations, Cubes & Dices, Venn Diagram, Analytical Reasoning (Counting Figures Reasoning)
  4. Cognizant Gaming Aptitude: Gamified / Game Based Aptitude
  5. Java (Cluster 1): Java
  6. ANSI SQL MySQL (Cluster 1,2,3): SQL
  7. HTML, CSS, JavaScript (Cluster 1,3): HTML, CSS, JavaScript
  8. Python (Cluster 2): Python for Placements by Yash Sir
  9. Cloud Fundamentals (Cluster 2): Emerging Tech Trends
  10. C# (Cluster 3): C#
  11. OOPs: Object Oriented Programming (OOPS)
  12. Technical Assessment (Coding): Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Pseudo Codes
  13. Data Structures: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  14. DBMS: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, Relational Calculus, Transaction Management, Concurrency Control, Database Recovery, ORDBMS, Database Security & Authorization, Query Processing & Optimization, Enhanced Data Models, Data Warehousing & Mining, Big Data Systems, NoSQL
  15. Operating Systems: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS, Linux OS, Security, Distributed Systems, Virtual Machines
  16. Computer Networks: Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This educational video lecture focuses on implementing deletion operations in a singly linked list using C-style pseudo-code. The instructor, Sanchit Jain, systematically breaks down two distinct scenarios: deleting a node from the very beginning of the list and deleting a node that follows a specific given location. Throughout the lesson, he utilizes on-screen code snippets and hand-drawn diagrams to visualize pointer manipulation, ensuring students understand how memory addresses are updated to maintain list integrity during deletion. The "Knowledge Gate" logo is visible in the background.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The session begins with the question displayed on screen: "Write a pseudo code for deleting a node from the starting of link-list?" The instructor presents a function `int delete(node *head)` and explains the initial safety check `if(head == null)` to handle underflow conditions. He then details the core logic: first, storing the data of the head node into a variable `Item` using `Item = head->data;`. Next, he explains the critical pointer update `head = head->next;`, which effectively removes the first node from the chain. Visually, he draws red arrows on the diagram showing the `head` pointer moving from node 'a' to node 'b', illustrating how the new head becomes the second node. The code concludes with `return item;` to return the deleted value. He also points to the `Void main()` block at the top left, showing `delete(*head)` as the function call. He draws memory addresses like 10, 20, 30, 40 under the nodes to represent physical storage locations.

  2. 2:00 – 4:50 02:00-04:50

    The lecture transitions to a new problem: "Write a pseudo code for deleting a node after a given location from the starting of link-list?" The function signature changes to `int delete(node *location)`. The instructor explains that here, we do not delete the node pointed to by `location`, but the one immediately following it. He writes `Item = location->next->data;` to capture the data of the target node. The crucial step is `Location->next = location->next->next;`, which bypasses the intermediate node. He draws red arrows on the diagram to show the link from node 'b' skipping node 'c' to point directly to node 'd'. He also briefly mentions the call `delete(*location)` in the `main` function, emphasizing that the logic relies on traversing the list to find the specific location before applying this deletion logic. The diagram labels the pointer as `loc` pointing to node 'b', and he again draws memory addresses 10, 20, 30, 40 under the nodes.

The video effectively demonstrates the mechanics of linked list deletion by contrasting head deletion with intermediate deletion. By visualizing pointer reassignment through red annotations, the instructor clarifies how nodes are physically removed from the sequence without necessarily freeing memory in the pseudo-code, focusing instead on the logical structure changes required for list traversal. This progression helps students understand that deletion is primarily about pointer manipulation rather than just memory deallocation.

Loading lesson…