Reverse String Without Built-in Functions
Duration: 3 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Quantitative Aptitude: Number System, Percentage, Profit and Loss, Ratio and Proportion (Ratios), Average, Time and Work, Speed Time and Distance, Simple Interest and Compound Interest, Mixture and Alligation, Data Interpretation, Permutation and Combination, Probability, Logarithm, Powers and Exponents (Surds and Indices), Age Problems, Divisibility Rules, Partnership, HCF LCM, Algebra, Pipe and Cistern
- Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Analogy, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Logical Sequence Of Words, Data Sufficiency, Seating Arrangements, Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Data Arrangement
- English Language: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Vocabulary, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Active Passive Voice (Voice), Direct and Indirect Speech, Cloze Test (Cloze Passage), Tenses, Subject Verb Agreement (Verb Noun Agreement), Preposition, Articles, Conjunction, Adverb
- Written English Test: English Writing Ability
- Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
- Communication Round: Communication Assessment
- DBMS (Technical Interview): 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, Big Data Systems, NoSQL, Data Warehousing & Mining
- SQL (Technical Interview): SQL
- Operating Systems (Technical Interview): 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
- Computer Networks (Technical Interview): 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, Cloud Computing and IoT, Cyber and Info Security
- OOPs (Technical Interview): Object Oriented Programming (OOPS)
- HR Interview: MR & HR Interview Preparation
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This video is a programming tutorial from Knowledge Gate, focusing on how to reverse a string without using built-in library functions. The instructor begins by stating the problem: 'Write a program to reverse a string without using inbuilt string reverse library functions'. He then uses a chalkboard to illustrate the concept with the string 'single', showing the process of swapping characters from the start and end of the string, moving towards the center. The core method demonstrated is the two-pointer technique, where a temporary variable is used to swap the characters at the start and end indices. The lesson transitions to a code editor, where the instructor writes a C function named 'reverseArray' that implements this logic. The function takes a character array and two integer indices, start and end, and uses a while loop to swap elements until the pointers meet. The instructor explains the code line by line, including the use of a temporary variable 'temp' to hold the value of the start character during the swap, and the increment of the start pointer and decrement of the end pointer. The video concludes with the complete, functional code for reversing a string.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with the Knowledge Gate logo, followed by a title card for a programming lecture. The instructor, Yash Jain Sir, introduces the topic: 'Write a program to reverse a string without using inbuilt string reverse library functions'. He then uses a chalkboard to visually explain the concept. He writes the string 'single' and draws a box around it, then illustrates the process of reversing it by showing a curved arrow that swaps the first and last characters, then the second and second-to-last, and so on. He writes the reversed string 'elgnis' below the original to demonstrate the final result. The instructor explains that this is a common interview question and that the method involves swapping characters from the beginning and end of the string, moving towards the center.
2:00 – 3:25 02:00-03:25
The instructor transitions from the chalkboard to a code editor to implement the string reversal algorithm. He writes a C function named 'void reverseArray(char arr[], int start, int end)'. He explains the function's parameters: a character array and two integer indices. He then writes a while loop: 'while (start < end)'. Inside the loop, he demonstrates the swapping process. He first declares a temporary variable: 'int temp = arr[start];'. He then performs the swap: 'arr[start] = arr[end];' and 'arr[end] = temp;'. He explains that this is the standard way to swap two values. Finally, he increments the start pointer and decrements the end pointer: 'start++;' and 'end--;'. He concludes by showing the complete function, which efficiently reverses the string in-place.
The video provides a clear, step-by-step tutorial on reversing a string without built-in functions. It begins with a conceptual explanation using a chalkboard to illustrate the two-pointer swap method, making the logic intuitive. This is followed by a practical implementation in C, where the instructor writes and explains the code for a function that performs the reversal. The synthesis of visual demonstration and code implementation effectively teaches the core algorithm, which is a fundamental concept in programming interviews.

