5 views

Uploaded by Priyadarshini Krishnaswamy

c debugging examples

- The Ring programming language version 1.5.1 book - Part 165 of 180
- Su Car Gillies 1994
- dsa ch6 tree
- DS OBJECTIVE QUESTIONS SET -3.doc
- ton01 IDMaps: Global Internet Host Distance Estimation Service HOPS (Host Proximity Service) “IDMaps” Service) SONAR/HOPS
- decision tree 1.pdf
- CS_3_8_syllabus 07102015
- Chess AI - Pseudo Code
- Robot
- AVR-GCC and the PROGMEM Attribute
- Splay
- Enchancing the Data Collection in Tree based Wireless Sensor Networks
- Decision Tree Basics
- Auto Agent Commission calculation Using BST
- Operations on Data Structures
- Data Structure 1
- Data Structures
- 1-s2.0-S1570870513001248-main.pdf
- Tree_material(3_classes).pdf
- Trees

You are on page 1of 4

MATHRIX 11

DEPARTMENT OF MATHEMATICS, CEG

1) Given a binary search tree, write a function which takes any given node from

the binary tree and a number. Function has to return the next higher number of

the given number from the binary search tree.

2) Efficient way to check palindrome in a link list

3) Algorithm to find the two numbers whose difference is minimum among the

set of numbers. For example the sequence is 5, 13, 7, 0, 10, 20, 1, 15, 4, 19 the

algorithm should return min diff = 20-19 = 1. Constraint - Time Complexity O(N)

& Space is not a constraint [upto O(3N)]

4) Given an image, how will you turn it by 90 degrees? An image can be treated

as 2D matrix which can be stored in a buffer. We are provided with matrix

dimensions and its base address. How can we turn it? For example see the

below picture,

***^***

***|***

***|***

***|***

After rotating right, it appears (observe arrow direction)

****

****

****

-- - - >

****

****

****

5) Compute n modulo d without division(/) and modulo(%) operators, where d is

a power of 2 number.

6) Given a root of a tree, and an integer k. Print all the nodes which are at k

distance from root. For example, in the below tree, 4, 5 & 8 are at distance 2

from root.

1

/ \

2

/ \

4

5 8

CODE BREAKERS

MATHRIX 11

DEPARTMENT OF MATHEMATICS, CEG

7) Given a string or array of characters, which contains repeating characters ,

write a method to return the first unique character

He has the following question to you !!!!

"{" "}" will it create new "Activation Record" (or Stack Frame) ?

int main()

{

int i=50;

{

int i=10;

printf("%d",i);

}

}

PREDICT THE OUTPUT

9)

main()

{

int i=300;

char *ptr;

ptr=&i;

*++ptr=2;

printf("%d",i);

}

10)

#include <iostream>

using namespace std;

int main()

{

int test = 0;

cout << "First character " << '1' << endl;

cout << "Second character " << (test ? 3 : '1') << endl;

return 0;

}

CODE BREAKERS

MATHRIX 11

DEPARTMENT OF MATHEMATICS, CEG

11)

struct aaa{

struct aaa *prev;

int i;

struct aaa *next;

};

main()

{

struct aaa abc,def,ghi,jkl;

int x=100;

abc.i=0;abc.prev=&jkl;

abc.next=&def;

def.i=1;def.prev=&abc;def.next=&ghi;

ghi.i=2;ghi.prev=&def;

ghi.next=&jkl;

jkl.i=3;jkl.prev=&ghi;jkl.next=&abc;

x=abc.next->next->prev->next->i;

printf("%d",x);

}

12) Hexspeak is a novelty speak of programmers who wanted a magic number, a

clear and unique identifier with which to mark memory or data using

hexadecimal notation. What do 0xFEE1DEAD mean ?

13) Given a number x, find next number with same number of 1 bits in its binary

representation.

For example, consider x = 12, whose binary representation is 1100 (excluding

leading zeros on 32 bit machine). It contains two logic 1 bits. The next higher

number with two logic 1 bits is 17 (100012).

14)

#define PrintInt(x,y) printf("%d %d\n",*x,y)

main()

{

int y = 100, *p=(int*)calloc(1,sizeof(int));

*p = 10;

y = y/*p;

*p=*p+y;

CODE BREAKERS

MATHRIX 11

DEPARTMENT OF MATHEMATICS, CEG

PrintInt(p,y);

}

15) Find the bugs else print the output

main()

{

const int x=5;

int *ptr;

ptr=&x;

*ptr=10;

printf("Const value changed to %d",x);

}

- The Ring programming language version 1.5.1 book - Part 165 of 180Uploaded byMahmoud Samir Fayed
- Su Car Gillies 1994Uploaded byalanruani
- dsa ch6 treeUploaded byapi-394738731
- DS OBJECTIVE QUESTIONS SET -3.docUploaded byAbinash Behera
- ton01 IDMaps: Global Internet Host Distance Estimation Service HOPS (Host Proximity Service) “IDMaps” Service) SONAR/HOPSUploaded byEco Economic Heartbeat
- decision tree 1.pdfUploaded byCART11
- CS_3_8_syllabus 07102015Uploaded byAnonymous HyCiDJwJm
- Chess AI - Pseudo CodeUploaded byVaibhav Bahadur
- RobotUploaded byVjay Narain
- AVR-GCC and the PROGMEM AttributeUploaded byleontti
- SplayUploaded byebsil sherly
- Enchancing the Data Collection in Tree based Wireless Sensor NetworksUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Decision Tree BasicsUploaded bySajan N Thomas
- Auto Agent Commission calculation Using BSTUploaded byEditor IJRITCC
- Operations on Data StructuresUploaded byAakashMalhotra
- Data Structure 1Uploaded bymagisraj
- Data StructuresUploaded bykrayya
- 1-s2.0-S1570870513001248-main.pdfUploaded byJayraj Singh
- Tree_material(3_classes).pdfUploaded byNaveen Gowdru
- TreesUploaded byRamiro Ivan Flappo
- sol6.pdfUploaded byAashish D
- Tree Drawing AlgortihmsUploaded byClaudioRusso
- Design and Analysis of AlgorithmsUploaded bySatyajit Mukherjee
- Streams & File IOUploaded byJPR EEE
- Syntax directed translationUploaded byShyjutestingShyju
- Write a C Program to Calculate Pow(x,n) _ GeeksforGeeksUploaded byNiraj Kumar
- Business FunctionUploaded byjramos1974
- 35-bstUploaded byanantha89
- Z Order CurveUploaded byParra Victor
- LinksUploaded byice_cute21

- Apple-Rubber-Chart_-Hot-Topics.pdfUploaded byPriyadarshini Krishnaswamy
- Module 5Uploaded bycaptainhass
- vg162Uploaded byPriyadarshini Krishnaswamy
- RAC Lecture 4Uploaded byapi-3734466
- PARKER - Oring HandBookUploaded byLuis Aparcana
- Module 2Uploaded bycaptainhass
- GJKUploaded bypradeep315
- Module 4Uploaded bycaptainhass
- Module 1Uploaded bycaptainhass
- Viton-O-ring-TDS.pdfUploaded byPriyadarshini Krishnaswamy
- Module 7Uploaded bycaptainhass
- Module 8Uploaded bycaptainhass
- Module 6Uploaded bycaptainhass
- Module 3Uploaded bycaptainhass
- 4462-90Uploaded byPriyadarshini Krishnaswamy
- Beams on Elastic FoundationUploaded byTRI MULYANTO
- ASTM D572.pdfUploaded byPriyadarshini Krishnaswamy
- D 471 – 06.pdfUploaded byLC Chong
- ASTM D139.pdfUploaded byPriyadarshini Krishnaswamy
- ASTM D139.pdfUploaded byPriyadarshini Krishnaswamy
- ASTMUploaded byHTC
- Viton-O-ring-TDS.pdfUploaded byPriyadarshini Krishnaswamy
- Fluorseals PTFE UnfilledUploaded byPriyadarshini Krishnaswamy
- Apple-Rubber-Chart_-Hot-Topics.pdfUploaded byPriyadarshini Krishnaswamy
- 3.pdfUploaded byPaolo Tanasi
- Fluorseals PTFE 15% Glass FilledUploaded byPriyadarshini Krishnaswamy
- Polikim EFALON® T-100 Virgin PTFEUploaded byPriyadarshini Krishnaswamy
- 4462-90.pdfUploaded byPriyadarshini Krishnaswamy
- 4462-90.pdfUploaded byPriyadarshini Krishnaswamy
- 4462-90.pdfUploaded byPriyadarshini Krishnaswamy

- DPR_GurdaspurUploaded byGurry Dhillon
- Auditing-Theory-3.docUploaded byMelcah Buhi
- Excerpt From "How To Raise A Wild Child" By Scott D. Sampson.Uploaded byOnPointRadio
- Electrical Tech Total 2012Uploaded byNGOUNE
- Fire Protection a Headline Story for NY Times BuildingUploaded byVictor Almazán
- SHS SIP Media and Information TechnologyUploaded byAnonymous WvQ6ZkDWWE
- AlleluiaUploaded byMichael_Cu_7544
- Child Protection: Dangers and InjuriesUploaded byJeff Prager
- Dictionary_of_Microbiology_&_Molecular_BiologyUploaded byviniciusrincao
- Copperhead, Why Wells Are PluggedUploaded bycopperheadpa
- dental trauma guidelines i fractures and luxations - flores anderson andreassenUploaded byapi-265532519
- 2018-26 Sept-st John the Beloved ApostleUploaded byMarguerite Paizis
- SLAM Techniques and AlgorithmsUploaded bynicholas777
- Edwards Vacuum PumpUploaded byแล้วแต่ จะคิด
- Outreach P1 MathUploaded byTai Wing Chan
- Phys 1402 Final ReviewUploaded byAline Murillo
- FM 15D310B LST USServiceManualUploaded byJaime Camo
- wp_top-10-sap-risksUploaded bygar2000
- A Study of Turning Gait Control for Quadruped Walking VehicleUploaded byMer Fro
- Tellabs Inspire Magazine: Telecom Namibia: An Emerging Leader in AfricaUploaded bymchaidez
- watch out for the visual cliffUploaded byapi-461124121
- the Magic in a Cuppa TeaUploaded byBlake Ragghianti
- Interruptores InteligentesUploaded byedgarwalter
- Solution 2Uploaded byJundi
- pdf syllabus assignmentUploaded byapi-316695029
- REFACEUploaded bykayal_vizhi_6
- The+Role+of+School+Librarians+in+Promoting+the+Use+of+Educational+Technologies 9 10Uploaded bypowell.gordon
- Human Resource Planning UNit 1Uploaded bygkrehman
- Chapter 12 FinalUploaded byMichael Hu
- Is Department Guidelines (2014-2015)Uploaded byDennyseOrlido